-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·64 lines (45 loc) · 1.24 KB
/
Makefile
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
58
59
60
61
62
63
64
NPM_BIN=./node_modules/.bin
# Constants #
#############
port_dev=5001
port_ssr=5002
# Use dist instead of build prefix
# to remove the need for PHONY
out=dist
out_dll_dev=dist-dll-dev
# Installation #
################
# Smart install: Only executes if package.json's
# modification date is later than node_module's
install: node_modules
node_modules: package.json
npm install
@touch -m node_modules
# Dev Mode #
############
dev: node_modules build-dll-dev
ENV=loc \
PORT=$(or $(port),$(port_dev)) \
$(NPM_BIN)/webpack-dev-server -d --progress --colors --open
$(out_dll_dev): node_modules webpack.dll.js webpack.config.js
rm -rf ./$(out_dll_dev)
OUTPUT_DLL=$(out_dll_dev) \
$(NPM_BIN)/webpack --config webpack.dll.js --progress --profile
build-dll-dev: $(out_dll_dev)
# Building #
############
gen-shells: node_modules
ENV=$(or $(env),loc) \
PORT=$(or $(port),$(port_ssr)) \
$(NPM_BIN)/ts-node -O '{"module":"commonjs","esModuleInterop":true}' src/ssr/gen-shells.tsx
build: node_modules src webpack.config.js
rm -rf ./$(out)
BUILD=true \
OUTPUT=$(out) \
$(NPM_BIN)/webpack --progress --profile
$(MAKE) gen-shells env=prd
$(NPM_BIN)/sw-precache --config=sw-precache-config.js
# Deployment #
##############
deploy: build
firebase deploy