1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-12-22 09:00:10 +00:00

add typechecking step to Makefile when DEBUG=on

This commit is contained in:
Harvey Tindall 2021-05-03 18:32:56 +01:00
parent 5d8f139356
commit 2c6d08319b
Signed by: hrfee
GPG Key ID: BBC65952848FB1A2
2 changed files with 4 additions and 1 deletions

View File

@ -31,11 +31,13 @@ DEBUG ?= off
ifeq ($(DEBUG), on) ifeq ($(DEBUG), on)
LDFLAGS := -s -w $(LDFLAGS) LDFLAGS := -s -w $(LDFLAGS)
SOURCEMAP := --sourcemap SOURCEMAP := --sourcemap
TYPECHECK := tsc -noEmit --project ts/tsconfig.json
# jank # jank
COPYTS := rm -r $(DATA)/web/js/ts; cp -r ts $(DATA)/web/js COPYTS := rm -r $(DATA)/web/js/ts; cp -r ts $(DATA)/web/js
else else
SOURCEMAP := SOURCEMAP :=
COPYTS := COPYTS :=
TYPECHECK :=
endif endif
npm: npm:
@ -59,6 +61,7 @@ email:
python3 scripts/compile_mjml.py -o $(DATA)/ python3 scripts/compile_mjml.py -o $(DATA)/
typescript: typescript:
$(TYPECHECK)
$(info compiling typescript) $(info compiling typescript)
-mkdir -p $(DATA)/web/js -mkdir -p $(DATA)/web/js
-$(ESBUILD) --bundle ts/admin.ts $(SOURCEMAP) --outfile=./$(DATA)/web/js/admin.js --minify -$(ESBUILD) --bundle ts/admin.ts $(SOURCEMAP) --outfile=./$(DATA)/web/js/admin.js --minify

View File

@ -3,7 +3,7 @@
"outDir": "../js", "outDir": "../js",
"target": "es6", "target": "es6",
"lib": ["dom", "es2017"], "lib": ["dom", "es2017"],
"typeRoots": ["./typings", "./node_modules/@types"], "typeRoots": ["./typings", "../node_modules/@types"],
"moduleResolution": "node", "moduleResolution": "node",
"esModuleInterop": true "esModuleInterop": true
} }