-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·36 lines (29 loc) · 913 Bytes
/
build.sh
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
33
34
35
36
#!/bin/sh
BUILD_ENV=$1
SSR=$2
BUILD_CONFIG_FILE=build-config/base.json
if [ ${SSR} = true ]; then
if [ -f build-config/${BUILD_ENV}.ssr.json ]; then
BUILD_CONFIG_FILE=build-config/${BUILD_ENV}.ssr.json
else
BUILD_CONFIG_FILE=build-config/base.ssr.json
fi
else
if [ -f build-config/${BUILD_ENV}.json ]; then
BUILD_CONFIG_FILE=build-config/${BUILD_ENV}.json
else
BUILD_CONFIG_FILE=build-config/base.json
fi
fi
echo "build env: ${BUILD_ENV}"
echo "is SSR: ${SSR}"
echo "build-config file: ${BUILD_CONFIG_FILE}"
# prepare
if [ -f server/env.json ]; then
rm server/env.json
fi
cp env/${BUILD_ENV}.json server/env.json
# build
alias fec-builder=./node_modules/.bin/fec-builder
fec-builder clean -c ${BUILD_CONFIG_FILE}
fec-builder -e production -c ${BUILD_CONFIG_FILE} -f ./env/${BUILD_ENV}.json --ISOMORPHIC_TOOLS_FILE ./server/isomorphic.js generate