diff --git a/.changeset/ninety-apples-retire.md b/.changeset/ninety-apples-retire.md new file mode 100644 index 000000000..be1a632dc --- /dev/null +++ b/.changeset/ninety-apples-retire.md @@ -0,0 +1,5 @@ +--- +'@rock-js/plugin-repack': patch +--- + +Expose reactNativePath in pluginRepack.ts to prevent undefined error in Re.Pack getDevMiddleware when starting up dev server diff --git a/packages/plugin-repack/src/lib/pluginRepack.ts b/packages/plugin-repack/src/lib/pluginRepack.ts index 55bb1e1d8..659414c01 100644 --- a/packages/plugin-repack/src/lib/pluginRepack.ts +++ b/packages/plugin-repack/src/lib/pluginRepack.ts @@ -40,6 +40,7 @@ export const pluginRepack = name: 'start', description: 'Starts Re.Pack dev server.', action: async (args: StartArgs) => { + const reactNativePath = api.getReactNativePath(); const root = api.getProjectRoot(); const platforms = api.getPlatforms(); const { port, startDevServer } = await findDevServerPort( @@ -54,7 +55,7 @@ export const pluginRepack = startCommand.func( [], // @ts-expect-error TODO fix getPlatforms type - { root, platforms, ...pluginConfig }, + { reactNativePath, root, platforms, ...pluginConfig }, { ...args, port }, ); },