Gravwell-Online/common/makefile
2022-06-22 00:40:10 -06:00

31 lines
No EOL
812 B
Makefile

.PHONY: all esm cjs test watch watch-esm watch-cjs
ESM_LOCATION=./esm
CJS_LOCATION=./cjs
all: esm cjs
esm:
@mkdir $(ESM_LOCATION) --parents
tsc --module es6 --outDir $(ESM_LOCATION)
cp ./package.json $(ESM_LOCATION)/package.json
cjs:
@mkdir $(CJS_LOCATION) --parents
tsc --module commonjs --outDir $(CJS_LOCATION)
cp ./package.json $(CJS_LOCATION)/package.json
watch:
@echo To have Typescript auto-rebuild, run the following commands in new terminals
@echo "\tmake watch-esm"
@echo "\tmake watch-cjs"
@echo These processes will not terminate, which is why they cannot be run in the same rule
watch-esm:
tsc --module es6 --outDir $(ESM_LOCATION) --watch
watch-cjs:
tsc --module commonjs --outDir $(CJS_LOCATION) --watch
test:
node_modules/mocha/bin/_mocha -r ts-node/register src/**/*.spec.ts