Skip to content

Commit

Permalink
fix(cli-core): avoid adding the same package to devDependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Dec 9, 2024
1 parent ce0b522 commit 8478081
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/cli-core/src/services/ProjectPackageJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ export class ProjectPackageJson {
addDevDependencies(modules: {[key: string]: string | undefined}, scope: any = {}) {
const replacer = (match: any, key: string) => getValue(key, scope);
Object.entries(modules).forEach(([pkg, version]) => {
this.addDevDependency(pkg, (version || "").replace(/{{([\w.]+)}}/gi, replacer));
if (!this.dependencies[pkg]) {
this.addDevDependency(pkg, (version || "").replace(/{{([\w.]+)}}/gi, replacer));
}
});

return this;
Expand Down

0 comments on commit 8478081

Please sign in to comment.