'output'路径有什么不同?tsconfig是一个加载器吗?webpack在运行tsconfig构建后解析'.ts'文件?
为什么文件'src.js'找不到了?它被webpack自动删除了吗?
tsconfig.json:
{
"compilerOptions": {
"module": "amd",
"noImplicitAny": true,
"removeComments": true,
"preserveConstEnums": true,
"outFile": "src.js",
"sourceMap": true
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules"
]
}
webpack.config.js:
module.exports = {
entry: './index.ts',
output: {
filename: './dest.js'
},
module: {
loaders: [{
test: /\.ts$/,
loader:'ts-loader'
}]
},
resolve: {
extensions: ['.webpack.js', '.web.js', '.ts', '.js']
}
}
非常感谢。
ts-loader
除了outFile
选项之外还使用此文件进行许多其他操作,因此它是必需的。我不理解你关于outFile
的第一个观点,你能详细说明一下吗? - Max Koretskyi