问题
首先描述一下问题:目前项目使用TypeScript,配置了tsconfig.json. 然后使用webpack + ts-loader来打包.
现在想问一下,tsconfig.json及ts-loader的作用是什么,是否需要加上babel-loader,希望熟悉构建工具的解释一下。
// tsconfig.json
{
"compilerOptions": {
"noImplicitAny": true,
"target": "es5",
"module": "commonjs",
"outDir": "tsdist/",
"sourceMap": true,
"jsx": "react",
"allowJs": true,
"typeRoots": [
"./node_modules/@types"
],
"lib": [
"es6",
"dom",
"scripthost"
]
},
"include": [
"tslib/**/*",
"tssrc/**/*"
]
}
已经打包为es5了就不需要babel-loader了