forked from systemjs/systemjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·165 lines (145 loc) · 4.11 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
VERSION = $(shell cat package.json | sed -n 's/.*"version": "\([^"]*\)",/\1/p')
ESML = node_modules/es6-module-loader/src
define BANNER
/*
* SystemJS v$(VERSION)
*/
endef
export BANNER
define POLYFILLS_BANNER
/*
* SystemJS Polyfills for URL and Promise providing IE8+ Support
*/
endef
export POLYFILLS_BANNER
define STANDARD_VERSION
System.version = '$(VERSION) Standard';
endef
export STANDARD_VERSION
define REGISTER_VERSION
System.version = '$(VERSION) Register Only';
endef
export REGISTER_VERSION
define CSP_VERSION
System.version = '$(VERSION) CSP';
endef
export CSP_VERSION
compile: clean-compile dist/system.src.js dist/system-csp-production.src.js dist/system-register-only.src.js
build: clean dist/system.js dist/system-csp-production.js dist/system-register-only.js dist/system-polyfills.js
version:
@echo $(VERSION)
footprint: build
@cat dist/system.js | gzip -9f | wc -c
@cat dist/system-csp-production.js | gzip -9f | wc -c
@cat dist/system-register-only.js | gzip -9f | wc -c
@cat dist/system-polyfills.js | gzip -9f | wc -c
clean-compile:
@rm -f dist/system.src.js dist/system-csp-production.src.js
clean:
@rm -f dist/*
test: compile
open test/test-traceur.html test/test-traceur-runtime.html
sleep 0.1
open test/test-babel.html test/test-babel-runtime.html
sleep 0.1
open test/test-typescript.html
sleep 0.1
open test/test-csp.html test/test-tracer.html
dist/system-polyfills.js: dist/system-polyfills.src.js
@echo "$$POLYFILLS_BANNER" > $@
cd dist && ../node_modules/.bin/uglifyjs $(subst dist/,,$<) --compress drop_console --mangle --source-map system-polyfills.js.map >> $(subst dist/,,$@) || rm $(subst dist/,,$@)
dist/%.js: dist/%.src.js
@echo "$$BANNER" > $@
cd dist && ../node_modules/.bin/uglifyjs $(subst dist/,,$<) --compress drop_console --mangle --source-map $*.js.map >> $(subst dist/,,$@) || rm $(subst dist/,,$@)
dist/system.src.js: lib/*.js $(ESML)/*.js
( echo "$$BANNER"; \
cat \
lib/wrapper-start.js \
$(ESML)/url-polyfill.js \
$(ESML)/wrapper-start.js \
$(ESML)/loader.js \
$(ESML)/dynamic-only.js \
$(ESML)/system.js \
$(ESML)/system-fetch.js \
$(ESML)/transpiler.js \
lib/proto.js \
lib/global-eval.js \
lib/core.js \
lib/package.js \
lib/scriptLoader.js \
lib/register.js \
lib/esm.js \
lib/global.js \
lib/global-helpers.js \
lib/cjs.js \
lib/cjs-helpers.js \
lib/amd-helpers.js \
lib/amd.js \
lib/plugins.js \
lib/conditionals.js \
lib/alias.js \
lib/meta.js \
lib/bundles.js \
lib/depCache.js \
lib/createSystem.js \
; echo "$$STANDARD_VERSION" ; cat \
$(ESML)/wrapper-end.js \
lib/wrapper-end.js \
) > $@;
dist/system-csp-production.src.js: lib/*.js $(ESML)/*.js
( echo "$$BANNER"; \
cat \
lib/wrapper-start.js \
$(ESML)/url-polyfill.js \
$(ESML)/wrapper-start.js \
$(ESML)/loader.js \
$(ESML)/dynamic-only.js \
$(ESML)/system.js \
$(ESML)/system-fetch.js \
lib/proto.js \
lib/core.js \
lib/package.js \
lib/scriptLoader.js \
lib/register.js \
lib/global-helpers.js \
lib/cjs-helpers.js \
lib/amd-helpers.js \
lib/plugins.js \
lib/conditionals.js \
lib/alias.js \
lib/meta.js \
lib/bundles.js \
lib/depCache.js \
lib/scriptOnly.js \
lib/createSystem.js \
; echo "$$CSP_VERSION" ; cat \
$(ESML)/wrapper-end.js \
lib/wrapper-end.js \
) > $@;
dist/system-register-only.src.js: lib/*.js $(ESML)/*.js
( echo "$$BANNER"; \
cat \
$(ESML)/url-polyfill.js \
$(ESML)/wrapper-start.js \
$(ESML)/loader.js \
$(ESML)/dynamic-only.js \
$(ESML)/system.js \
$(ESML)/system-resolve.js \
lib/proto.js \
lib/scriptLoader.js \
lib/register.js \
lib/bundles.js \
lib/scriptOnly.js \
lib/createSystem.js \
; echo "$$REGISTER_VERSION" ; cat \
$(ESML)/wrapper-end.js \
) > $@;
dist/system-polyfills.src.js: lib/*.js $(ESML)/*.js
( echo "$$POLYFILLS_BANNER"; \
echo "(function(define) {"; \
echo ""; \
cat \
node_modules/when/es6-shim/Promise.js \
lib/polyfills-bootstrap.js; \
echo "})();" \
) > $@;