与模块编译打字稿及捆绑到一个文件 [英] Compile TypeScript with modules and bundle to one file
本文介绍了与模块编译打字稿及捆绑到一个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在使用模块
在 tsconfig.json
的打字稿编译器会忽略任何 - 退房手续
标记并生成常规输出,如 CommonJS的
模块单独的文件中。
When using a module
inside tsconfig.json
the TypeScript compiler will ignore any --out
flags and generate regular output, e.g. commonjs
modules in seperate files.
有没有一种方法来捆绑所有transpiled文件合并为一个文件?
Is there a way to bundle all transpiled files into a single file?
我目前正在使用的WebPack却无法得到任何的装载机运行。运行打字稿直接编译工作。
I am currently trying to use webpack but can not get any of the loaders to run. Running the TypeScript compiler directly works.
推荐答案
有关打字稿外部模块包,你可以使用NPM包的 TsProject
For typescript external module bundles you can use the npm package TsProject
这篇关于与模块编译打字稿及捆绑到一个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文