使用vite打包时报错:
error TS6305: Output file 'D:/xxx/src/utils/common.d.ts' has not been built from source file 'D:/xxx/src/utils/common.ts'.
The file is in the program because:
Matched by include pattern 'src' in 'D:/xxx/tsconfig.json'
tsconfig.json:19:15
19 "include": ["src"],
~~~~~
File is matched by include pattern specified here.
Found 1 error.
根目录的tsconfig.json
{
"compilerOptions": {
.....
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
}
tsconfig.node.json
{
"compilerOptions": {
"composite": true,
.....
},
"include": ["vite.config.ts", "package.json", "electron", "src/utils"]
}
把tsconfig.node.json的include里的src删掉即可