@wz-libs/ts-to-js v1.1.0
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 defaultfalseThe dtsFile property can be exported as a *.d.ts file path such aslib/typesmjsFiles(Boolean) - Whether to generate esm(es6)*.mjxFile. The defaultfalseBy default, the js file of the es5 is generatedterserCode(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.tspackage.jsonsettingtype: commonjsExecute with the commandtsToJs.build.config.js | build.config.tspackage.jsonsettingtype: moduleExecute 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 themoduleResolution: nodeormodule: commonjsproperty:
{
"compilerOptions": {
"moduleResolution": "node"
}
}commander
build- Compileclean- Clearing output Files