diff --git a/.changeset/polite-rockets-double.md b/.changeset/polite-rockets-double.md new file mode 100644 index 000000000..66f645453 --- /dev/null +++ b/.changeset/polite-rockets-double.md @@ -0,0 +1,5 @@ +--- +"@callstack/repack-init": patch +--- + +Fix bad package name when creating/updating react-native.config.js diff --git a/packages/init/src/tasks/handleReactNativeConfig.ts b/packages/init/src/tasks/handleReactNativeConfig.ts index 90de165cc..ec887678e 100644 --- a/packages/init/src/tasks/handleReactNativeConfig.ts +++ b/packages/init/src/tasks/handleReactNativeConfig.ts @@ -6,8 +6,8 @@ import logger from '../utils/logger.js'; const defaultConfig = dedent` module.exports = { - commands: require('repack/commands'), - }`; + commands: require('@callstack/repack/commands'), + };`; /** * Checks whether react-native.config.js exists and adds the commands to it @@ -29,14 +29,14 @@ export default function handleReactNativeConfig(cwd: string): void { if (!configContent.includes('commands:')) { updatedConfigContent = configContent.replace( 'module.exports = {', - "module.exports = {\n commands: require('repack/commands')," + "module.exports = {\n commands: require('@callstack/repack/commands')," ); } else { const commandsIndex = configContent.indexOf('commands:'); const commandsEndIndex = configContent.indexOf(',', commandsIndex); const commandsString = configContent.slice(commandsIndex, commandsEndIndex); - const newCommandsString = `commands: require('repack/commands')`; + const newCommandsString = `commands: require('@callstack/repack/commands')`; if (commandsString === newCommandsString) { logger.success('File react-native.config.js is already up to date'); return;