Replace bash prepare script with node version

This commit is contained in:
Bill Thornton
2020-12-17 12:25:39 -05:00
parent d66d26b4f6
commit 37dd3fe2b8
3 changed files with 13 additions and 6 deletions
+12
View File
@@ -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
View File
@@ -1,5 +0,0 @@
#!/usr/bin/env bash
if [ -z "${SKIP_PREPARE}" ]; then
webpack --config webpack.prod.js
fi