diff --git a/client/package.json b/client/package.json index 76dd79148..3df5cb9c6 100644 --- a/client/package.json +++ b/client/package.json @@ -92,7 +92,7 @@ "build": "webpack --config webpack.production.config.js", "build-external": "EXTERNAL=true webpack --config webpack.production.config.js", "build-pkg": "babel app/scripts --ignore __tests__ --out-dir dist", - "install": "npm run build-pkg", + "install": "./post-install.sh", "start": "node server.js", "start-production": "NODE_ENV=production node server.js", "test": "jest", diff --git a/client/post-install.sh b/client/post-install.sh new file mode 100755 index 000000000..d50143ddc --- /dev/null +++ b/client/post-install.sh @@ -0,0 +1,7 @@ +pwd=$(pwd) +if [[ $pwd == *"node_modules"* ]]; then + echo "Installed as Node module. Building package..." + npm run build-pkg + else + echo "Installed as stand-alone UI. Skipped building package" +fi