diff --git a/website/client/package.json b/website/client/package.json index 07fb2d29e0..9629f78772 100644 --- a/website/client/package.json +++ b/website/client/package.json @@ -7,7 +7,7 @@ "build": "vue-cli-service build", "test:unit": "vue-cli-service test:unit --require ./tests/unit/helpers.js", "lint": "vue-cli-service lint", - "postinstall": "if [ -n \"$npm_config_production\" ]; then npm run build; fi" + "postinstall": "node ./scripts/npm-postinstall.js" }, "dependencies": { "@vue/cli-plugin-babel": "^4.0.4", diff --git a/website/client/scripts/npm-postinstall.js b/website/client/scripts/npm-postinstall.js new file mode 100644 index 0000000000..6d1b3e4d21 --- /dev/null +++ b/website/client/scripts/npm-postinstall.js @@ -0,0 +1,5 @@ +const { execSync } = require('child_process'); + +if (process.env.NODE_ENV === 'production') { + execSync('npm run build'); +}