-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
45 lines (30 loc) · 1020 Bytes
/
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
CLIENT=$(shell find client -iname '*.ts' -or -iname '*.tsx' -or -iname '*.scss')
STATIC=$(shell find static -type f -not -name '.*')
# convert
FILENAME=uwp.js
DEV_FILE=build/development/$(FILENAME)
PROD_FILE=build/production/$(FILENAME)
# phony stuff
all: production
production: $(PROD_FILE)
development: $(DEV_FILE)
# actual work
node_modules: package.json
npm install
touch node_modules
clean:
rm -rf dist build node_modules
dist: production Makefile
@mkdir -p dist/js
cp $(PROD_FILE) $(PROD_FILE).map dist/js
cp -a static/* dist/
find dist/ -type f ! -name '*.gz' -exec gzip -fk "{}" \;
$(DEV_FILE): $(CLIENT) $(STATIC) node_modules Makefile webpack.config.js .babelrc
node_modules/.bin/webpack --env development
$(PROD_FILE): $(CLIENT) $(STATIC) node_modules Makefile webpack.config.js .babelrc
node_modules/.bin/webpack --env production
serve: node_modules
node_modules/.bin/webpack-dev-server --env development
FORCE:
.PHONY: all dist production development client serve
.DELETE_ON_ERROR: