【发布时间】:2017-07-29 05:37:12
【问题描述】:
我正在使用 typescript 将我的应用程序捆绑到一个 .js 文件中。据我了解,自 TS 1.8 以来这是可能的(我使用的是 2.1)。这是我的 .tsconfig
{
"compileOnSave": true,
"compilerOptions": {
"experimentalDecorators": true,
"alwaysStrict": true,
"jsx": "react",
"noEmitOnError": true,
"outFile": "dist/bundle.js",
"moduleResolution": "node",
"preserveConstEnums": true,
"removeComments": true,
"sourceMap": true,
"target": "es5",
"module": "system"
},
"exclude": [
"node_modules",
"wwwroot"
]
}
这确实创建了 bundle.js 文件,但来自 node_modules 的引用模块不在此包中。是否可以以某种方式将模块添加到包中?
我知道这可以使用 Webpack 或类似工具来完成,但我的问题是是否可以只使用 typescript 来完成
【问题讨论】:
标签: javascript typescript bundling-and-minification