Build all your TypeScript files into JavaScript.
Add configuration and setup scripts:
npm install -D -E typescript-esbuild
Through a command line run:
npx typescript-esbuild 'Source/**/*.ts'
or in a package.json
file:
{
"scripts": {
"prepublishOnly": "TypeScriptESBuild 'Source/**/*.ts'"
}
}
Or with a custom ESBuild config file:
package.json
{
"scripts": {
"prepublishOnly": "TypeScriptESBuild 'Source/**/*.ts' -es ESBuild.ts"
}
}
See an example of a configuration file in ESBuild.ts
tsconfig.json
{
"compilerOptions": {
"outDir": "Target"
},
"extends": "typescript-esbuild/Target/Notation/TypeScript",
"include": ["Source"]
}