Skip to content

Commit

Permalink
Modified prepare.js by renaming it to prepare.mjs and upgrading t…
Browse files Browse the repository at this point in the history
…he husky installation mechanic to use ESM import instead of the old CommonJS require.
  • Loading branch information
wes-EBP committed Jan 29, 2024
1 parent 52c53b7 commit 2ce22a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"watch": "ng build --configuration development",
"test": "ng test",
"test-ci": "ng test --no-watch --no-progress --code-coverage",
"prepare": "node ./prepare.js",
"prepare": "node ./prepare.mjs",
"update-version": "node ./update-version.js",
"format-all": "prettier --write ./src",
"generate-gb3-api": "npx swagger-typescript-api -p https://maps.zh.ch/api-docs/gb3/v1/swagger.yaml -o ./src/app/shared/models -n gb3-api-generated.interfaces.ts --no-client --extract-response-body --extract-request-body --extract-request-body && node ./remove-generated-api-version-references.js ./src/app/shared/models/gb3-api-generated.interfaces.ts"
Expand Down
5 changes: 3 additions & 2 deletions prepare.js → prepare.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
* Install husky only if the npm was called without omitting 'dev'
* Or in other words: install husky only in a development environment
*
* For more information see: https://typicode.github.io/husky/#/?id=with-a-custom-script
* For more information see: https://typicode.github.io/husky/how-to.html#ci-server-and-docker
*/
const installHusky = process.env.npm_config_omit !== 'dev';
if (installHusky) {
require('husky').install();
const husky = (await import('husky')).default;
console.log(husky());
}

0 comments on commit 2ce22a3

Please sign in to comment.