Skip to content

Commit 3612bb1

Browse files
committed
tsconfig配置修改
1 parent 7893fef commit 3612bb1

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

tsconfig.json

+11-13
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,31 @@
33
"module": "ESNext",
44
"target": "es6",
55
"moduleResolution": "node",
6-
"allowSyntheticDefaultImports": true,
6+
77
//允许从没有设置默认导出的模块中默认导入。这并不影响代码的输出,仅为了类型检查。
8-
9-
//我感觉baseUrl和paths都不用,因为有webpack啊
10-
"baseUrl": ".",// import的相对起始路径 // 解析非相对模块名的基准目录
11-
// `vs code`所需要的,在开发时找到对应的路径,真实的引用是在`webpack`中配置的`alias`
12-
// 所以这个配置没有鬼用啊
8+
"allowSyntheticDefaultImports": true,
9+
"sourceMap": true,
10+
"removeComments": false,
11+
12+
// import的相对起始路径 // 解析非相对模块名的基准目录
13+
"baseUrl": ".",
1314
"paths": {
1415
"@/*":["./src/*"],
1516
"public/*": ["./public/*"],
1617
"components/*": ["./src/components/*"],
1718
"pages/*": ["./src/pages/*"],
1819
"layout/*": ["./src/layout/*"]
1920
},
21+
2022
// 开启装饰器的使用
2123
"experimentalDecorators": true,
2224
"emitDecoratorMetadata": true,
25+
2326
// 开启`JSX`模式,
2427
// `preserve`的配置让`tsc`不会去处理它,而是使用后续的`babel-loader`进行处理
25-
"jsx": "preserve", // 但他默认就是preserve,所以其实可以删了
26-
27-
"sourceMap": true,
28-
28+
"jsx": "react",
2929
"strict": true, // 启用严格模式
30-
"noImplicitAny": true,
31-
32-
30+
"noImplicitAny": true
3331
},
3432
"exclude": [
3533
"node_modules"

0 commit comments

Comments
 (0)