From 04b18641ff82d7b4f6300b16c61038691d407d9e Mon Sep 17 00:00:00 2001 From: Matteo Pagliazzi Date: Thu, 24 Oct 2019 14:06:20 +0200 Subject: [PATCH] fix windows postinstall --- website/client/package.json | 2 +- website/client/scripts/npm-postinstall.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 website/client/scripts/npm-postinstall.js 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'); +}