Skip to content

Commit

Permalink
docs: add FAQ chapters and sections
Browse files Browse the repository at this point in the history
  • Loading branch information
qmhc committed Nov 10, 2021
1 parent 3b4628e commit b455a04
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion README.md
Expand Up @@ -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

Expand Down Expand Up @@ -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.
12 changes: 11 additions & 1 deletion README.zh-CN.md
Expand Up @@ -148,7 +148,7 @@ export interface PluginOptions {
}
```

## Example
## 示例

克隆项目然后执行下列命令:

Expand All @@ -158,6 +158,16 @@ yarn run test:e2e

然后检查 `example/types` 目录。

## 常见问题

此处将收录一些常见的问题并提供一些解决方案。

### 打包后出现类型文件缺失

默认情况下 `skipDiagnostics` 选项的值为 `true`,这意味着打包过程中将跳过类型检查(一些项目通常有 `vue-tsc` 等的类型检查工具),这时如果出现存在类型错误的文件,并且这是错误会中断打包过程,那么这些文件对应的类型文件将不会被生成。

如果您的项目没有依赖外部的类型检查工具,这时候可以您可以设置 `skipDiagnostics: false``logDiagnostics: true` 来打开插件的诊断与输出功能,这将帮助您检查打包过程中出现的类型错误并将错误信息输出至终端。

## 授权

MIT 授权。

0 comments on commit b455a04

Please sign in to comment.