insomnia/scripts/build.sh

30 lines
669 B
Bash
Raw Normal View History

2016-07-07 20:10:55 +00:00
#!/bin/bash
#? Package the app
2016-07-18 20:10:18 +00:00
BUILD_DIR='./build'
2016-07-07 20:10:55 +00:00
echo "-- REMOVING DIST FOLDER --"
rm -r "$BUILD_DIR"
2016-07-07 20:10:55 +00:00
echo "-- BUILDING PRODUCTION APP --"
NODE_ENV=production node -r babel-register ./node_modules/.bin/webpack --config ./webpack/webpack.config.production.js
echo "-- COPYING REMAINING FILES --"
# Copy package JSON
# TODO: Remove the need for both of these
cp app/app.json "$BUILD_DIR/package.json"
cp app/app.json "$BUILD_DIR/app.json"
2016-07-07 20:10:55 +00:00
# Copy some things
2016-07-18 20:10:18 +00:00
cp app/app.js "$BUILD_DIR/"
cp -r app/images "$BUILD_DIR/"
cp -r app/external "$BUILD_DIR/"
2016-07-07 20:10:55 +00:00
echo "-- INSTALLING PACKAGES --"
2016-07-18 20:10:18 +00:00
cd "$BUILD_DIR"/
2016-07-18 19:44:46 +00:00
NODE_ENV=production npm install
2016-07-07 20:10:55 +00:00
2016-07-18 19:44:46 +00:00
echo "-- BUILD COMPLETE --"