2 # This generates everything under dist:
3 # bundled JS, minified JS, minified CSS and source maps.
8 # Create dist/dygraph.js
12 -t
[ envify
--NODE_ENV development
] \
14 --standalone Dygraph \
18 # Create dist/dygraph.js.map
19 cat dist
/dygraph.tmp.js | exorcist
--base . dist
/dygraph.js.map
> dist
/dygraph.js
21 # Create "production" bundle for minification
25 -t
[ envify
--NODE_ENV production
] \
27 --standalone Dygraph \
31 # Create dist/dygraph.tmp.js.map
32 cat dist
/dygraph.tmp.js | exorcist
--base . dist
/dygraph.tmp.js.map
> /dev
/null
34 header
='/*! @license Copyright 2017 Dan Vanderkam (danvdk@gmail.com) MIT-licensed (http://opensource.org/licenses/MIT) */'
36 # Create dist/dygraph.js.min{,.map}
37 uglifyjs
--compress --mangle \
38 --preamble
"$header" \
39 --in-source-map dist
/dygraph.tmp.js.map \
40 --source-map-include-sources \
41 --source-map dist
/dygraph.min.js.map \
42 -o dist
/dygraph.min.js \
46 jar
-cf dist
/dygraph-gwt.jar
-C gwt org
49 cp css
/dygraph.css dist
/
50 cleancss css
/dygraph.css
-o dist
/dygraph.min.css
--source-map
--source-map-inline-sources
52 # Build ES5-compatible distribution
53 babel src
-d src-es5
--compact false
56 rm dist
/dygraph.tmp.js
57 rm dist
/dygraph.tmp.js.map