-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TS-Errors when building with Vite v5.3.1
#343
Comments
hello, today I meet the same problem with you。I solve it by a few steps that I hope my solution can help you or give you some light or tips。My English is poor , but I will try my best to explain it hhh。as follows : environmentI introduce my environment as I meet the problem that similar with yours : my root files about tsconfig have three, all of three are : tsconfig.json, tsconfig.app.json, tsconfig.node.json。and my tsconfig.json ( the remaining two is not important for this plugin ) source code is : {
"files": [],
"references": [
{
"path": "./tsconfig.node.json"
},
{
"path": "./tsconfig.app.json"
}
]
} solveOK let's solve the problem :
{
"extends": "@vue/tsconfig/tsconfig.dom.json",
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
},
"references": [
{
"path": "./tsconfig.node.json"
},
{
"path": "./tsconfig.app.json"
}
]
}
plugins: [
vue(),
vueJsx(),
dts({
tsconfigPath: './tsconfig.build.json',
}),
],
explainNow I explain why do this will work : /**
* Specify tsconfig.json path
*
* Plugin resolves `include` and `exclude` globs from tsconfig.json
*
* If not specified, plugin will find config file from root
*/
tsconfigPath?: string, it mean's dts( ) default resolves more tipsif you use
in your tsconfig.build.json then in your project you don‘ use relative path such as all in all, good luck to you , hope you will solve your problem |
I got there due to a similar problem, since this issue on GitHub could be shown to someone else, this was my scenario and my solution: https://dev.to/manuartero/ts-transpiling-absolute-path-statements-in-your-npm-package-f15. hope this helps. |
|
Describe the bug
When creating a new project using template
vue-ts
and usingvite-plugin-dts
for building a library, you'll get TS errors for external libraries.Reproduction
https://github.com/razorness/vite-dts-compile-errors
Steps to reproduce
yarn create vite --template vue-ts
vite-plugin-dts
and configure:yarn add --dev vite-plugin-dts
yarn add --dev taze
yarn taze major -I
main.ts
yarn build
System Info
Validations
The text was updated successfully, but these errors were encountered: