1 |
|
2 |
|
3 | dir="$(dirname "${BASH_SOURCE[0]}")/.."
|
4 | # Copy ES6 source file
|
5 | cp $dir/src/ImageDrop.js $dir/index.js
|
6 | # Copy the template
|
7 | cp $dir/src/es5-wrapper.js $dir/image-drop.min.js
|
8 | # Compile to ES5
|
9 | js=$(node $dir/node_modules/babel-cli/bin/babel.js $dir/src/ImageDrop.js --presets=es2015 | $dir/node_modules/uglify-js/bin/uglifyjs -m)
|
10 | echo $js > tmp.js
|
11 | # Wrap
|
12 | sed -i '' -e '/MINIFIED_JS/r tmp.js' -e '/MINIFIED_JS/d' $dir/image-drop.min.js
|
13 | rm tmp.js |
\ | No newline at end of file |