-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.sh
58 lines (48 loc) · 2.14 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
52
53
54
55
56
57
#!/bin/bash
echo '*************************************************************************'
echo POSTINSTALL
echo '*************************************************************************'
#echo '*************************************************************************'
#echo These directoies need to exist in dist, even if you don't have them in your project
#echo '*************************************************************************'
mkdir -p dist/events
mkdir -p dist/routes
mkdir -p dist/socket-apis
mkdir -p dist/web-components
#
# assets is where static files go
#
# you can start with the favicon images from civil-server - but you may want to replace them with your own some day
mkdir -p ./assets/images
# cp -rp node_modules/civil-server/assets/images ./assets
cp -rp assets/favicon/* assets/images
echo '***'
echo Svgr
echo '***'
npm run svgr
#
# Update/create web-components/index.js to require all react components in that director, and in the listed child/peer directories
#
react-directory-indexer app/web-components/ node_modules/civil-server/dist/web-components/ node_modules/undebate/dist/web-components/
react-directory-indexer --data app/data-components/ node_modules/civil-server/dist/data-components/ node_modules/undebate/dist/data-components/
# need this for app/components/election-date but its kind of a kludge
jss convert node_modules/react-calendar/dist/Calendar.css -f js -e cjs > node_modules/react-calendar/dist/react-calendar-css.js
#echo '*************************************************************************'
#echo TRANSPILE
#echo '*************#************************************************************'
#
npm run transpile || {
echo Could not transpile;
exit 1
}
echo "transpile ok"
echo '*************************************************************************'
echo WEBPACK
echo '*************************************************************************'
# 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-ssp\" ; then {
npm run packbuild || {
echo Could not webpack;
exit 1
}
}; fi