Skip to content

Commit

Permalink
fix(create-rsbuild): fix package#name if create in current dir (#2522)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Jun 5, 2024
1 parent 210befe commit 42fd6a9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/create-rsbuild/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ const updatePackageJson = (
let content = fs.readFileSync(pkgJsonPath, 'utf-8');
content = content.replace(/workspace:\*/g, `^${version}`);
const pkg = JSON.parse(content);
if (name) pkg.name = name;

if (name && name !== '.') {
pkg.name = name;
}

fs.writeFileSync(pkgJsonPath, JSON.stringify(pkg, null, 2));
};

Expand Down

0 comments on commit 42fd6a9

Please sign in to comment.