我正在尝试对我的 tsconfig.json 使用绝对路径。现在,出于某种原因,我只能获得在 .ts 和 .tsx 文件中工作的绝对路径,而不能在 .js 和 .jsx 中工作。
{
"compilerOptions": {
"baseUrl": "./src",
"module": "NodeNext",
"moduleResolution": "node16",
"target": "ES2022",
"jsx": "react-jsx",
"strictNullChecks": true,
"strictFunctionTypes": true,
"sourceMap": true,
"paths": {
"*": ["*"]
}
},
"exclude": [
"node_modules",
"**/node_modules/*"
],
"include": [
"./src/**/*.ts",
"./src/**/*.tsx",
"./src/**/*.js",
"./src/**/*.jsx",
]
}
我在 tsconfig.json 中缺少
"allowJs" : true
键值