-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.sh
53 lines (45 loc) · 1.68 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
#*************************************************************************'
# These directoies need to exist in dist, even if you don't have them in your project
# *************************************************************************'
mkdir -p dist/events
mkdir -p dist/routes
mkdir -p dist/socket-apis
mkdir -p dist/data-components
mkdir -p dist/web-components
#
# assets is where static files go
#
mkdir -p ./assets/js/
# you can start with the favicon images from civil-server - but you should to replace them with your own some day
mkdir -p ./assets/images
cp -rp node_modules/civil-server/assets/images ./assets/images
#
# Update/create web-components/index.js to require all react components in that director, and in the listed child/peer directories. Web components are used by the getIota route - which uses reactServerRender
#
react-directory-indexer app/web-components/ node_modules/civil-server/dist/web-components/ || {
echo Could not build web-components
exit 1
}
#
# Update/create data-components/index.js to require all data-components in that director, and in the listed child/peer directories. Data components are used by the getIota route.
#
react-directory-indexer --data app/data-components/ node_modules/civil-server/dist/data-components/ || {
echo Could not build data-components
exit 1
}
npm run svgr || {
echo Could not svgr
exit 1
}
npm run transpile || {
echo Could not transpile;
exit 1
}
# don't run webpack if this is a dependency of another project - the memory usage will blow out heroku build
if test \"$NPM_PROJECT\" = \"\" || test \"$NPM_PROJECT\" == \"undebate\" ; then {
npm run packbuild || {
echo Could not webpack;
exit 1
}
}; fi