generated from KTH/node-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
32 lines (25 loc) · 800 Bytes
/
build.sh
File metadata and controls
32 lines (25 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
ENV=$1
function echoYellow() {
MSG=$1
printf "\033[1;33m$MSG\033[0m\n"
}
echo
echoYellow "|--------------------------------------------------------|"
echoYellow "| Building the application with Bash and Webpack |"
echoYellow "|--------------------------------------------------------|\n"
if [ "$ENV" == "prod" ]; then
echo
echoYellow " 1. Bundling the client app into the /dist folder\n"
WEBPACK_ENV=prod WEBPACK_MODE=build webpack
echo
echoYellow " Done.\n"
fi
if [ "$ENV" == "dev" ]; then
echo
echoYellow " 1. Bundling the client app into the /dist folder to list results\n"
WEBPACK_ENV=dev WEBPACK_MODE=build webpack
echo
echoYellow " 2. Running watch on client app. Check /dist for changes\n"
WEBPACK_ENV=dev WEBPACK_MODE=watch webpack
fi