You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-12Lines changed: 17 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -59,18 +59,6 @@ Starting with `3.0.0`, you can use this plugin with Rollup.
59
59
60
60
Here are some FAQ's and solutions.
61
61
62
-
### Missing some declaration files after build (before `1.7.0`)
63
-
64
-
By default, the `skipDiagnostics` option is set to `true` which means type diagnostics will be skipped during the build process (some projects may have diagnostic tools such as `vue-tsc`). Files with type errors which interrupt the build process will not be emitted (declaration files won't be generated).
65
-
66
-
If your project doesn't use type diagnostic tools, you can set `skipDiagnostics: false` and `logDiagnostics: true` to turn on diagnostic and logging features of this plugin. Type errors during build will be logged to the terminal.
67
-
68
-
### Type error when using both `script` and `setup-script` in Vue component (before `3.0.0`)
69
-
70
-
This is usually caused by using the `defineComponent` function in both `script` and `setup-script`. When `vue/compiler-sfc` compiles these files, the default export result from `script` gets merged with the parameter object of `defineComponent` from `setup-script`. This is incompatible with parameters and types returned from `defineComponent`. This results in a type error.
71
-
72
-
Here is a simple [example](https://github.com/qmhc/vite-plugin-dts/blob/main/examples/vue/components/BothScripts.vue). You should remove the `defineComponent` in `script` and export a native object directly.
73
-
74
62
### Type errors that are unable to infer types from packages in `node_modules`
75
63
76
64
This is an existing [TypeScript issue](https://github.com/microsoft/TypeScript/issues/42873) where TypeScript infers types from packages located in `node_modules` through soft links (pnpm). A workaround is to add `baseUrl` to your `tsconfig.json` and specify the `paths` for these packages:
@@ -96,6 +84,23 @@ For example: `baseUrl: 'src'` is specified and importing from `<root>/src/compon
96
84
97
85
Currently, you need to avoid the above situation, or use aliases instead (with the `paths` option).
98
86
87
+
<details>
88
+
<summary>Legacy</summary>
89
+
90
+
### Missing some declaration files after build (before `1.7.0`)
91
+
92
+
By default, the `skipDiagnostics` option is set to `true` which means type diagnostics will be skipped during the build process (some projects may have diagnostic tools such as `vue-tsc`). Files with type errors which interrupt the build process will not be emitted (declaration files won't be generated).
93
+
94
+
If your project doesn't use type diagnostic tools, you can set `skipDiagnostics: false` and `logDiagnostics: true` to turn on diagnostic and logging features of this plugin. Type errors during build will be logged to the terminal.
95
+
96
+
### Type error when using both `script` and `setup-script` in Vue component (before `3.0.0`)
97
+
98
+
This is usually caused by using the `defineComponent` function in both `script` and `setup-script`. When `vue/compiler-sfc` compiles these files, the default export result from `script` gets merged with the parameter object of `defineComponent` from `setup-script`. This is incompatible with parameters and types returned from `defineComponent`. This results in a type error.
99
+
100
+
Here is a simple [example](https://github.com/qmhc/vite-plugin-dts/blob/main/examples/vue/components/BothScripts.vue). You should remove the `defineComponent` in `script` and export a native object directly.
0 commit comments