@wz-libs/ts-to-js
v1.1.0
Published
A tool for translating typescript into javascript
Downloads
3
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 defaultlib
external
(Array|Function) - Set external import dependencies and use rules(https://rollupjs.org/guide/en/#external)dtsFile
(Boolean|String) - Whether to generate the corresponding*.d.ts
File. The defaultfalse
[The dtsFile property can be exported as a *.d.ts file path such aslib/types
]mjsFiles
(Boolean) - Whether to generate esm(es6)*.mjx
File. The defaultfalse
[By default, the js file of the es5 is generated]terserCode
(Boolean) - Whether to enable compression code. The defaultfalse
plugins
(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.json
settingtype: commonjs
] Execute with the commandtsToJs
.build.config.js | build.config.ts
[package.json
settingtype: module
] Execute with the commandtsToJsEsm
.If
dtsFile: true
is set, error code may be reported:TS2792
, where you need to create thetsconfig.json
file in the project root and add the [moduleResolution: node
ormodule: commonjs
] property:
{
"compilerOptions": {
"moduleResolution": "node"
}
}
commander
build
- Compileclean
- Clearing output Files