【发布时间】:2019-04-25 14:03:23
【问题描述】:
我使用create-react-app app_name --typescript 创建了我的 React 应用程序。由于 Typescript 不支持 NODE_PATH。我正在尝试在 tsconfig.json 中使用 baseUrl。
但是,每次在将"baseUrl": "src" 放入"compilerOptions" 之后运行yarn start,baseUrl 都会消失。我觉得yarn start 重置了tsconfig.json。
如何阻止它重置文件?
**tsconfig.json**
{
"compilerOptions": {
"target": "es6",
"allowJs": true,
"skipLibCheck": false,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve"
},
"include": ["src"]
}
【问题讨论】:
标签: typescript