From 2c6d08319b029218f2fba43e99fbde6549b71325 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Mon, 3 May 2021 18:32:56 +0100 Subject: [PATCH] add typechecking step to Makefile when DEBUG=on --- Makefile | 3 +++ ts/tsconfig.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2c33077..0debb02 100644 --- a/Makefile +++ b/Makefile @@ -31,11 +31,13 @@ DEBUG ?= off ifeq ($(DEBUG), on) LDFLAGS := -s -w $(LDFLAGS) SOURCEMAP := --sourcemap + TYPECHECK := tsc -noEmit --project ts/tsconfig.json # jank COPYTS := rm -r $(DATA)/web/js/ts; cp -r ts $(DATA)/web/js else SOURCEMAP := COPYTS := + TYPECHECK := endif npm: @@ -59,6 +61,7 @@ email: python3 scripts/compile_mjml.py -o $(DATA)/ typescript: + $(TYPECHECK) $(info compiling typescript) -mkdir -p $(DATA)/web/js -$(ESBUILD) --bundle ts/admin.ts $(SOURCEMAP) --outfile=./$(DATA)/web/js/admin.js --minify diff --git a/ts/tsconfig.json b/ts/tsconfig.json index 3b3b207..4bdf020 100644 --- a/ts/tsconfig.json +++ b/ts/tsconfig.json @@ -3,7 +3,7 @@ "outDir": "../js", "target": "es6", "lib": ["dom", "es2017"], - "typeRoots": ["./typings", "./node_modules/@types"], + "typeRoots": ["./typings", "../node_modules/@types"], "moduleResolution": "node", "esModuleInterop": true }