Skip to content

Commit

Permalink
Merge pull request #2242 from thornbill/fix-prepare-script-windows
Browse files Browse the repository at this point in the history
Replace bash prepare script with node version
  • Loading branch information
thornbill committed Dec 17, 2020
2 parents 41e2cc6 + 37dd3fe commit 898704d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"scripts": {
"start": "yarn serve",
"serve": "webpack serve --config webpack.dev.js",
"prepare": "./scripts/prepare.sh",
"prepare": "node ./scripts/prepare.js",
"build:development": "webpack --config webpack.dev.js",
"build:production": "webpack --config webpack.prod.js",
"lint": "eslint \"src/\"",
Expand Down
12 changes: 12 additions & 0 deletions scripts/prepare.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { execSync } = require('child_process');

/**
* The npm `prepare` script needs to run a build to support installing
* a package from git repositories (this is dumb but a limitation of how
* npm behaves). We don't want to run these in CI though because
* building is slow so this script will skip the build when the
* `SKIP_PREPARE` environment variable has been set.
*/
if (!process.env.SKIP_PREPARE) {
execSync('webpack --config webpack.prod.js', { stdio: 'inherit' });
}
5 changes: 0 additions & 5 deletions scripts/prepare.sh

This file was deleted.

0 comments on commit 898704d

Please sign in to comment.