compile typescript in one go

much faster, especially with --incremental
This commit is contained in:
Damien Elmes 2019-12-18 14:33:57 +10:00
parent b676e484d3
commit f3bfed82ef
10 changed files with 30 additions and 9 deletions

View File

@ -51,7 +51,7 @@ clean:
rm -rf .build rm -rf .build
rm -rf $(JSDEPS) rm -rf $(JSDEPS)
build: .build/ui js build: .build/ui .build/js
.build/ui: $(shell find designer -name '*.ui') .build/ui: $(shell find designer -name '*.ui')
./tools/build_ui.sh ./tools/build_ui.sh
@ -86,12 +86,9 @@ pytype: .build/pytype
pytype --config pytype.conf pytype --config pytype.conf
touch $@ touch $@
.PHONY: js TSDEPS := $(wildcard ts/src/*.ts)
JSDEPS := $(patsubst ts/src/%.ts, web/%.js, $(TSDEPS))
TSDEPS := $(wildcard ts/*.ts) .build/js: $(TSDEPS)
JSDEPS := $(patsubst ts/%.ts, web/%.js, $(TSDEPS)) (cd ts && ./node_modules/.bin/tsc --build)
touch $@
js: $(JSDEPS)
web/%.js: ts/%.ts
(cd ts && ./node_modules/.bin/tsc --lib es6,dom lib/global.d.ts $(notdir $<) --outFile ../web/$(notdir $@))

1
ts/.gitignore vendored
View File

@ -1 +1,2 @@
node_modules node_modules
.buildinfo

23
ts/tsconfig.json Normal file
View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"rootDir": "src",
"outDir": "../web",
"incremental": true,
"tsBuildInfoFile": "./.buildinfo",
"strict": true,
/* Enable all strict type-checking options. */
"noImplicitAny": false,
/* Raise error on expressions and declarations with an implied 'any' type. */
"strictNullChecks": false,
/* Enable strict null checks. */
"noImplicitThis": false,
/* Raise error on 'this' expressions with an implied 'any' type. */
"esModuleInterop": true
}
}