A simple script to build both .js
(CommonJS) and .mjs
(ES6) modules
from the same TypeScript project and into a single directory.
If source maps are present they will be renamed and modified accordingly.
Run npx tsc-both
in the directory with tsconfig.json
. outDir
must be set.
WARNING: outDir
will be completely wiped before recompilation.
{
...
"scripts": {
"build": "npx tsc-both",
"prepare": "npm run build"
},
"devDependencies": {
"tsc-both": "0.1.x"
}
...
}