| 1 | #!/bin/bash |
| 2 | mkdir -p dist |
| 3 | |
| 4 | browserify \ |
| 5 | -v \ |
| 6 | -t babelify \ |
| 7 | -t [ envify --NODE_ENV production ] \ |
| 8 | --debug \ |
| 9 | --standalone Dygraph \ |
| 10 | src/dygraph.js \ |
| 11 | > dist/dygraph.js |
| 12 | |
| 13 | # Create dist/dygraph.js.map |
| 14 | cat dist/dygraph.js | exorcist --base . dist/dygraph.js.map > /dev/null |
| 15 | |
| 16 | # Create dist/dygraph.js.min{,.map} |
| 17 | uglifyjs --compress --mangle \ |
| 18 | --in-source-map dist/dygraph.js.map \ |
| 19 | --source-map-include-sources \ |
| 20 | --source-map dist/dygraph.min.js.map \ |
| 21 | -o dist/dygraph.min.js \ |
| 22 | dist/dygraph.js |
| 23 | |
| 24 | # Copy to the old location |
| 25 | cp dist/dygraph.min.js dist/dygraph-combined.js |