2016-07-07 20:10:55 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#? Package the app
|
|
|
|
|
2016-08-23 19:27:46 +00:00
|
|
|
set -e
|
|
|
|
|
2016-07-18 20:10:18 +00:00
|
|
|
BUILD_DIR='./build'
|
|
|
|
|
2016-07-07 20:10:55 +00:00
|
|
|
echo "-- REMOVING DIST FOLDER --"
|
2016-08-23 19:31:26 +00:00
|
|
|
if [ -d "$BUILD_DIR" ]; then
|
|
|
|
rm -r "$BUILD_DIR"
|
|
|
|
fi
|
2016-07-07 20:10:55 +00:00
|
|
|
|
|
|
|
echo "-- BUILDING PRODUCTION APP --"
|
2016-08-23 19:43:01 +00:00
|
|
|
cross-env NODE_ENV=production --config ./webpack/webpack.config.production.babel.js
|
2016-07-07 20:10:55 +00:00
|
|
|
|
|
|
|
echo "-- COPYING REMAINING FILES --"
|
|
|
|
|
2016-07-19 16:59:26 +00:00
|
|
|
# Copy package JSON
|
|
|
|
cp app/app.json "$BUILD_DIR/app.json"
|
2016-07-23 08:22:52 +00:00
|
|
|
cp app/app.json "$BUILD_DIR/package.json"
|
2016-07-19 16:59:26 +00:00
|
|
|
|
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-08-23 18:54:22 +00:00
|
|
|
cross-env NODE_ENV=production npm install
|
2016-07-07 20:10:55 +00:00
|
|
|
|
2016-07-18 19:44:46 +00:00
|
|
|
echo "-- BUILD COMPLETE --"
|