summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNavaL <ayoyo@thoughtworks.com>2016-03-22 11:25:24 +0100
committerNavaL <ayoyo@thoughtworks.com>2016-03-22 11:30:06 +0100
commit48b41c39c1b61dee262955fe09b062355833c268 (patch)
treecbf02e864103593a08b02d492e81b2092464efce
parent4a7275b7ddcf214af20216cdd85122e2e83c028f (diff)
removed minified js libraries before our minification
expressly added non-zero exit code if minification fails upgraded minify version Issue #655
-rw-r--r--web-ui/config/package.sh19
-rw-r--r--web-ui/package.json2
2 files changed, 12 insertions, 9 deletions
diff --git a/web-ui/config/package.sh b/web-ui/config/package.sh
index 8daa263d..165eeff3 100644
--- a/web-ui/config/package.sh
+++ b/web-ui/config/package.sh
@@ -45,31 +45,34 @@ bower_components/font-awesome/fonts/* \
../dist
cd -
-# prepend -comma and space- to concatenated app js so that minify does not blow up
-echo '; ' | cat - .tmp/app.concatenated.js > /tmp/out && mv /tmp/out .tmp/app.concatenated.js
-
# concat js files and minify for app.min.js
cat \
app/bower_components/modernizr/modernizr.js \
app/bower_components/lodash/dist/lodash.js \
app/bower_components/jquery/dist/jquery.js \
-app/bower_components/jquery-ui/jquery-ui.min.js \
+app/bower_components/jquery-ui/jquery-ui.js \
app/bower_components/jquery-file-upload/js/jquery.fileupload.js \
app/js/lib/highlightRegex.js \
-app/bower_components/handlebars/handlebars.min.js \
-app/bower_components/typeahead.js/dist/typeahead.bundle.min.js \
+app/bower_components/handlebars/handlebars.js \
+app/bower_components/typeahead.js/dist/typeahead.bundle.js \
app/bower_components/foundation/js/foundation.js \
app/bower_components/foundation/js/foundation/foundation.reveal.js \
app/bower_components/foundation/js/foundation/foundation.offcanvas.js \
app/js/foundation/initialize_foundation.js \
-app/bower_components/iframe-resizer/js/iframeResizer.min.js \
+app/bower_components/iframe-resizer/js/iframeResizer.js \
.tmp/app.concatenated.js > dist/app.js
node_modules/.bin/minify dist/app.js > dist/app.min.js
rm dist/app.js
+if [ ! -s dist/app.min.js ]
+then
+echo "Minification failed!"
+exit 1;
+fi
+
# concat js files and minify for sandbox.min.js
cat \
app/js/sandbox.js \
-app/bower_components/iframe-resizer/js/iframeResizer.contentWindow.min.js > dist/sandbox.js
+app/bower_components/iframe-resizer/js/iframeResizer.contentWindow.js > dist/sandbox.js
node_modules/.bin/minify dist/sandbox.js > dist/sandbox.min.js
rm dist/sandbox.js
diff --git a/web-ui/package.json b/web-ui/package.json
index 22572560..fae3fb19 100644
--- a/web-ui/package.json
+++ b/web-ui/package.json
@@ -18,7 +18,7 @@
"karma-phantomjs-launcher": "0.1.4",
"karma-requirejs": "0.2.2",
"karma-coverage": "0.2.7",
- "minify": "1.4.10",
+ "minify": "^2.0.5",
"requirejs": "2.1.22",
"watch": "0.17.1"
},