@wz-libs/ts-to-js
v1.1.0
Published
A tool for translating typescript into javascript
Downloads
19
Maintainers
Readme
ts-to-js
introduction
rollup tools to translate typescript into javascript.
build.config.ts Or build.config.js
input(String|Object) - Specifies the entry file path. The defaultsrc/index,Rules of Use (https://rollupjs.org/guide/en/#input)output(String) - Specifies the folder directory after compilation. The defaultlibexternal(Array|Function) - Set external import dependencies and use rules(https://rollupjs.org/guide/en/#external)dtsFile(Boolean|String) - Whether to generate the corresponding*.d.tsFile. The defaultfalse[The dtsFile property can be exported as a *.d.ts file path such aslib/types]mjsFiles(Boolean) - Whether to generate esm(es6)*.mjxFile. The defaultfalse[By default, the js file of the es5 is generated]terserCode(Boolean) - Whether to enable compression code. The defaultfalseplugins(Array) - Rollup the plugins property is merged with the default plugin [@rollup/plugin-typescript,@rollup/plugin-commonjs,rollup-plugin-dts,@rollup/plugin-json,@rollup/plugin-babel,@rollup/plugin-node-resolve]
NOTE
build.config.js | build.config.ts[package.jsonsettingtype: commonjs] Execute with the commandtsToJs.build.config.js | build.config.ts[package.jsonsettingtype: module] Execute with the commandtsToJsEsm.If
dtsFile: trueis set, error code may be reported:TS2792, where you need to create thetsconfig.jsonfile in the project root and add the [moduleResolution: nodeormodule: commonjs] property:
{
"compilerOptions": {
"moduleResolution": "node"
}
}commander
build- Compileclean- Clearing output Files
