2023-11-13 11:03:35 +00:00
|
|
|
.PHONY: build
|
2023-12-05 08:19:42 +00:00
|
|
|
build: node browser types
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm dist/dta.*
|
|
|
|
|
|
|
|
## Types
|
|
|
|
.PHONY: types
|
|
|
|
types: dta.ts
|
|
|
|
tsc -d --emitDeclarationOnly --declarationDir types $<
|
|
|
|
mv types/dta.d.ts types/index.d.ts
|
2023-11-13 11:03:35 +00:00
|
|
|
|
|
|
|
## NodeJS target
|
|
|
|
|
|
|
|
.PHONY: node
|
|
|
|
node: dist/dta.js
|
|
|
|
|
|
|
|
dist/dta.js: dta.ts
|
2024-03-22 04:39:09 +00:00
|
|
|
npx esbuild@0.14.14 $< --bundle --outfile=$@ --platform=node
|
2023-11-13 11:03:35 +00:00
|
|
|
|
|
|
|
.PHONY: test-node
|
|
|
|
test-node: dist/dta.js test.js
|
|
|
|
npx mocha@2.5.3 test.js
|
|
|
|
|
|
|
|
## Browser target
|
|
|
|
.PHONY: browser
|
|
|
|
browser: dist/dta.min.js
|
|
|
|
|
|
|
|
dist/dta.min.js: dta.ts
|
2024-03-22 04:39:09 +00:00
|
|
|
npx esbuild@0.14.14 $< --bundle --outfile=$@ --minify --sourcemap --global-name=DTA
|
|
|
|
|
|
|
|
dist/dta.mjs: dta.ts
|
|
|
|
npx esbuild@0.14.14 $< --bundle --outfile=$@ --minify --sourcemap --format=esm
|
2023-11-13 11:03:35 +00:00
|
|
|
|