vite-plugin-dts 0.9.2 → 0.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -122,10 +122,13 @@ export interface PluginOptions {
122
122
  noEmitOnError?: boolean
123
123
 
124
124
  // Whether skip typescript diagnostics
125
+ // Skip type diagnostics means that type errors will not interrupt the build process
126
+ // But for the source files with type errors will not be emitted
125
127
  // Default: true
126
128
  skipDiagnostics?: boolean
127
129
 
128
130
  // Whether log diagnostic informations
131
+ // Not effective when `skipDiagnostics` is true
129
132
  // Default: false
130
133
  logDiagnostics?: boolean
131
134
 
@@ -156,6 +159,16 @@ yarn run test:e2e
156
159
 
157
160
  Then check `example/types`.
158
161
 
162
+ ## FAQ
163
+
164
+ Here will include some FAQ's and provide some solutions.
165
+
166
+ ### Missing some declaration files after build
167
+
168
+ By default `skipDiagnostics` option is `true`, which means that type diagnostic will be skipped during the build process (some projects may have diagnostic tool such as `vue-tsc`). If there are some files with type errors which will interrupt the build process, these files will not be emitted (not generate declaration files).
169
+
170
+ If your project has not type diagnostic tools, you can set `skipDiagnostics: false` and `logDiagnostics: true` to turn on the diagnostic and log features of this plugin. It will help you to check the type errors during build and log error information to the terminal.
171
+
159
172
  ## License
160
173
 
161
174
  MIT License.
package/README.zh-CN.md CHANGED
@@ -121,10 +121,13 @@ export interface PluginOptions {
121
121
  noEmitOnError?: boolean
122
122
 
123
123
  // 是否跳过类型诊断
124
+ // 跳过类型诊断意味着出现错误时不会中断打包进程的执行
125
+ // 但对于出现错误的源文件,将无法生成相应的类型文件
124
126
  // 默认值: true
125
127
  skipDiagnostics?: boolean
126
128
 
127
129
  // 是否打印类型诊断信息
130
+ // 当跳过类型诊断时该属性将不会生效
128
131
  // 默认值: false
129
132
  logDiagnostics?: boolean
130
133
 
@@ -145,7 +148,7 @@ export interface PluginOptions {
145
148
  }
146
149
  ```
147
150
 
148
- ## Example
151
+ ## 示例
149
152
 
150
153
  克隆项目然后执行下列命令:
151
154
 
@@ -155,6 +158,16 @@ yarn run test:e2e
155
158
 
156
159
  然后检查 `example/types` 目录。
157
160
 
161
+ ## 常见问题
162
+
163
+ 此处将收录一些常见的问题并提供一些解决方案。
164
+
165
+ ### 打包后出现类型文件缺失
166
+
167
+ 默认情况下 `skipDiagnostics` 选项的值为 `true`,这意味着打包过程中将跳过类型检查(一些项目通常有 `vue-tsc` 等的类型检查工具),这时如果出现存在类型错误的文件,并且这是错误会中断打包过程,那么这些文件对应的类型文件将不会被生成。
168
+
169
+ 如果您的项目没有依赖外部的类型检查工具,这时候可以您可以设置 `skipDiagnostics: false` 和 `logDiagnostics: true` 来打开插件的诊断与输出功能,这将帮助您检查打包过程中出现的类型错误并将错误信息输出至终端。
170
+
158
171
  ## 授权
159
172
 
160
- MIT License
173
+ MIT 授权。
package/dist/index.d.ts CHANGED
@@ -26,4 +26,4 @@ interface PluginOptions {
26
26
  }
27
27
  declare function dtsPlugin(options?: PluginOptions): Plugin;
28
28
 
29
- export { PluginOptions, dtsPlugin as default };
29
+ export { dtsPlugin as default };