Skip to content

Commit

Permalink
fix: omit package.json type if commonjs (#27611)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima authored Oct 17, 2024
1 parent 3e226f3 commit 19e1c76
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions generators/common/__snapshots__/generator.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ This application was generated using JHipster JHIPSTER_VERSION, you can find doc
"name": "jhipster",
"version": "0.0.0",
"description": "Description for JHipster",
"license": "UNLICENSED",
"type": "commonjs"
"license": "UNLICENSED"
}
",
"stateCleared": "modified",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ exports[`generator - javascript:bootstrap customVersion-commonjs should match fi
"name": "dasherizedBaseName",
"version": "0.0.0",
"description": "projectDescription",
"license": "UNLICENSED",
"type": "commonjs"
"license": "UNLICENSED"
}
",
"stateCleared": "modified",
Expand Down Expand Up @@ -73,8 +72,7 @@ exports[`generator - javascript:bootstrap packageJsonNodeEngine(true) should mat
"name": "dasherizedBaseName",
"version": "0.0.0",
"description": "projectDescription",
"license": "UNLICENSED",
"type": "commonjs"
"license": "UNLICENSED"
}
",
"stateCleared": "modified",
Expand Down
2 changes: 1 addition & 1 deletion generators/javascript/generators/bootstrap/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default class BootstrapGenerator extends BaseApplicationGenerator {
description: projectDescription,
license: 'UNLICENSED',
});
if (packageJsonType) {
if (packageJsonType === 'module') {
this.packageJson.merge({ type: packageJsonType });
}
if (packageJsonNodeEngine) {
Expand Down

0 comments on commit 19e1c76

Please sign in to comment.