#!/bin/bash
-# This generates:
-# - dist/dygraph.js
-# - dist/dygraph.js.map
-# - dist/dygraph.min.js
-# - dist/dygraph.min.js.map
+# This generates everything under dist:
+# bundled JS, minified JS, minified CSS and source maps.
set -o errexit
mkdir -p dist
-o dist/dygraph.min.js \
dist/dygraph.tmp.js
-# Copy to the old location
-cp dist/dygraph.min.js dist/dygraph-combined.js
-
# 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
+
+# Build ES5-compatible distribution
+babel src -d src-es5 --compact false
+
# Remove temp files.
rm dist/dygraph.tmp.js
rm dist/dygraph.tmp.js.map