diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..cb06283 --- /dev/null +++ b/build.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -x +# Build the App +./node_modules/.bin/parcel build + +# Minify the JS +if [ ! -d ./dist/minified_js ]; then + mkdir ./dist/minified_js +fi +for file in ./dist/*.js; do + echo "== MINIFYING $file ==" + ./node_modules/.bin/uglifyjs --mangle --compress -o "./dist/minified_js/$(basename $file)" -- $file +done diff --git a/package-lock.json b/package-lock.json index d5e8a7d..a6b163d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12333,21 +12333,13 @@ "dev": true }, "uglify-js": { - "version": "3.4.7", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.7.tgz", - "integrity": "sha512-J0M2i1mQA+ze3EdN9SBi751DNdAXmeFLfJrd/MDIkRc3G3Gbb9OPVSx7GIQvVwfWxQARcYV2DTxIkMyDAk3o9Q==", + "version": "3.4.9", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", + "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", "dev": true, "requires": { - "commander": "~2.16.0", + "commander": "~2.17.1", "source-map": "~0.6.1" - }, - "dependencies": { - "commander": { - "version": "2.16.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.16.0.tgz", - "integrity": "sha512-sVXqklSaotK9at437sFlFpyOcJonxe0yST/AG9DkQKUdIE6IqGIMv4SfAQSKaJbSdVEJYItASCrBiVQHq1HQew==", - "dev": true - } } }, "uglifyjs-webpack-plugin": { diff --git a/package.json b/package.json index 588a90d..5a6531c 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "parcel-bundler": "^1.9.7", "ts-jest": "^23.1.4", "typescript": "^2.9.2", + "uglify-js": "^3.4.9", "webpack": "4.17.1", "webpack-cli": "3.1.0" },