From b455a04ae3d53117eded452dee95a1a81c1a9b8b Mon Sep 17 00:00:00 2001 From: rk_zhang <40221744+qmhc@users.noreply.github.com> Date: Wed, 10 Nov 2021 11:29:48 +0800 Subject: [PATCH] docs: add FAQ chapters and sections --- README.md | 12 +++++++++++- README.zh-CN.md | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 374940c..bbe48cd 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ export interface PluginOptions { // Whether skip typescript diagnostics // Skip type diagnostics means that type errors will not interrupt the build process - // But for the source files with type errors will not be emitted. + // But for the source files with type errors will not be emitted // Default: true skipDiagnostics?: boolean @@ -159,6 +159,16 @@ yarn run test:e2e Then check `example/types`. +## FAQ + +Here will include some FAQ's and provide some solutions. + +### Missing some declaration files after build + +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). + +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. + ## License MIT License. diff --git a/README.zh-CN.md b/README.zh-CN.md index 75cdfd1..3c34da7 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -148,7 +148,7 @@ export interface PluginOptions { } ``` -## Example +## 示例 克隆项目然后执行下列命令: @@ -158,6 +158,16 @@ yarn run test:e2e 然后检查 `example/types` 目录。 +## 常见问题 + +此处将收录一些常见的问题并提供一些解决方案。 + +### 打包后出现类型文件缺失 + +默认情况下 `skipDiagnostics` 选项的值为 `true`,这意味着打包过程中将跳过类型检查(一些项目通常有 `vue-tsc` 等的类型检查工具),这时如果出现存在类型错误的文件,并且这是错误会中断打包过程,那么这些文件对应的类型文件将不会被生成。 + +如果您的项目没有依赖外部的类型检查工具,这时候可以您可以设置 `skipDiagnostics: false` 和 `logDiagnostics: true` 来打开插件的诊断与输出功能,这将帮助您检查打包过程中出现的类型错误并将错误信息输出至终端。 + ## 授权 MIT 授权。