Created
May 3, 2019 16:19
-
-
Save boyswan/95db668b2e5c3074309ccdfcc3ba9108 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
COMMAND="build" | |
USAGE=" | |
Usage: bundle application [-w] [-h] \n\n | |
-w watch for file changes and rebuild the bundle \n | |
-h help \n | |
" | |
while getopts "wh" opt; do | |
case $opt in | |
w) | |
COMMAND=watch | |
;; | |
h) | |
echo "$USAGE" 1>&2 | |
exit 1 | |
;; | |
esac | |
done | |
shift "$((OPTIND - 1))" | |
echo "bundler ${COMMAND}ing..." | |
fpack $COMMAND --development ./src/Index.bs.js \ | |
-o ./public/scripts \ | |
--name "main.bundle.js" \ | |
--nm "$(pwd)" \ | |
--nm "$(pwd)/node_modules" \ | |
--nm node_modules \ | |
--preprocess='^node_modules/@dexda.+\.js$:babel-loader?filename=.babelrc' \ | |
--preprocess='^src.[^\.]+\.js$:babel-loader?filename=.babelrc' \ | |
--preprocess='.css$:style-loader!css-loader' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment