Skip to content

Commit 2e175c5

Browse files
committed
feat: add .npmrc handling in create-app script
- Implemented functionality to copy the _npmrc file to .npmrc during app creation. - Removed the template .npmrc file as it is no longer needed. This update enhances the app setup process by ensuring necessary npm configurations are applied automatically.
1 parent 82bcb88 commit 2e175c5

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

packages/create-app/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ function main() {
8484
unlinkSync(gitignoreSrc);
8585
}
8686

87+
const npmrcSrc = join(targetDir, '_npmrc');
88+
if (existsSync(npmrcSrc)) {
89+
writeFileSync(join(targetDir, '.npmrc'), readFileSync(npmrcSrc, 'utf8'));
90+
unlinkSync(npmrcSrc);
91+
}
92+
8793
console.log('Installing dependencies...');
8894
const install = spawnSync('npm', ['install'], { cwd: targetDir, stdio: 'inherit', shell: true });
8995
if (install.status !== 0) {

0 commit comments

Comments
 (0)