From 147263e347553e4c8f990055765873dc6a0ea98c Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Wed, 28 Dec 2016 12:52:20 -0500 Subject: [PATCH] Generate minified CSS --- package.json | 1 + scripts/build.sh | 4 ++++ scripts/push-to-web.sh | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index c5a8d0b..508b714 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "browserify": "^11.2.0", "browserify-header": "^0.9.2", "chai": "^3.3.0", + "clean-css": "^3.4.23", "coveralls": "^2.11.2", "envify": "^3.4.0", "exorcist": "^0.4.0", diff --git a/scripts/build.sh b/scripts/build.sh index 279597a..3122d03 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -48,6 +48,10 @@ uglifyjs --compress --mangle \ # Build GWT JAR jar -cf dist/dygraph-gwt.jar -C gwt org +# Minify CSS +cp css/dygraph.css dist/ +cleancss css/dygraph.css -o dist/dygraph.min.css --source-map --source-map-inline-sources + # Remove temp files. rm dist/dygraph.tmp.js rm dist/dygraph.tmp.js.map diff --git a/scripts/push-to-web.sh b/scripts/push-to-web.sh index 7d062d4..29bf648 100755 --- a/scripts/push-to-web.sh +++ b/scripts/push-to-web.sh @@ -32,7 +32,7 @@ if [ -s docs/options.html ] ; then # Copy everything to the site. rsync -avzr src src/extras gallery common tests jsdoc $site \ && \ - rsync -avzr --copy-links dist/* css/* thumbnail.png screenshot.png $temp_dir/* $site/ + rsync -avzr --copy-links dist/* thumbnail.png screenshot.png $temp_dir/* $site/ else echo "generate-documentation.py failed" fi -- 2.7.4