Skip to content

Commit 8c3a2b0

Browse files
authored
docs: update plugin compatible table (#8526)
* docs: update plugin compatible table * docs: update
1 parent f6763a9 commit 8c3a2b0

File tree

9 files changed

+80
-37
lines changed

9 files changed

+80
-37
lines changed

website/components/CommunityCompatibleTable.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ export const CommunityPluginCompatibleTable: React.FC = () => {
112112
{
113113
name: 'fork-ts-checker-webpack-plugin',
114114
url: 'https://github.com/TypeStrong/fork-ts-checker-webpack-plugin',
115-
status: CompatibleStatus.Compatible,
115+
status: CompatibleStatus.Alternative,
116+
description: i18n[lang]['fork-ts-checker-webpack-plugin-desc'],
116117
},
117118
{
118119
name: 'html-webpack-plugin',
119120
url: 'https://www.npmjs.com/package/html-webpack-plugin',
120121
status: CompatibleStatus.Compatible,
121-
description: i18n[lang]['html-webpack-plugin-desc'],
122122
},
123123
{
124124
name: 'mini-css-extract-plugin',
@@ -236,8 +236,7 @@ export const CommunityPluginCompatibleTable: React.FC = () => {
236236
{
237237
name: 'webpackbar',
238238
url: 'https://www.npmjs.com/package/webpackbar',
239-
status: CompatibleStatus.NotCompatible,
240-
description: i18n[lang]['progress-plugin-desc'],
239+
status: CompatibleStatus.Compatible,
241240
},
242241
{
243242
name: 'progress-bar-webpack-plugin',

website/components/i18n/en.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"included": "included",
55
"babel-loader-description": "SWC has been used internally to implement babel-loader with most of its conversion capabilities",
66
"babel-loader-remark": "Be cautious of the performance impact of babel-loader",
7-
"html-webpack-plugin-desc": "Support for this plugin was implemented in v0.3.3, please upgrade the Rspack version to use it",
8-
"sentry_webpack-plugin-desc": "Support for the plugin version v1.20.1 and above has been implemented in v0.3.3",
7+
"sentry_webpack-plugin-desc": "Support for this plugin >= v1.20.1",
98
"copy-plugin-desc": "Use [CopyRspackPlugin](/plugins/rspack/copy-rspack-plugin) instead",
109
"mini-css-extract-plugin-desc": "Use [CssExtractRspackPlugin](/plugins/rspack/css-extract-rspack-plugin) instead",
1110
"terser-webpack-plugin-desc": "Rspack provides [SwcJsMinimizerRspackPlugin](/plugins/rspack/swc-js-minimizer-rspack-plugin) to deliver better performance",
@@ -24,8 +23,9 @@
2423
"webpack-filter-warnings-plugin-desc": "Use [ignoreWarnings](/config/other-options#ignorewarnings) instead",
2524
"speed-measure-webpack-plugin-desc": "Use [Rsdoctor](/guide/optimization/use-rsdoctor) instead",
2625
"eslint-webpack-plugin-desc": "Use [eslint-rspack-plugin](https://github.com/rspack-contrib/eslint-rspack-plugin) instead",
27-
"circular-dependency-plugin-desc": "Use Eslint [import/no-cycle](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-cycle.md) rule instead",
26+
"circular-dependency-plugin-desc": "Use ESLint [import/no-cycle](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-cycle.md) rule instead",
2827
"html-webpack-tags-plugin-desc": "Use [html-rspack-tags-plugin](https://github.com/rspack-contrib/html-rspack-tags-plugin) instead",
2928
"needs-html-webpack-plugin": "This plugin depends on html-webpack-plugin",
30-
"webpack-assets-manifest-desc": "Only supports basic usage"
29+
"webpack-assets-manifest-desc": "Only supports basic usage",
30+
"fork-ts-checker-webpack-plugin-desc": "Use [ts-checker-rspack-plugin](https://github.com/rspack-contrib/ts-checker-rspack-plugin) instead"
3131
}

website/components/i18n/zh.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"included": "已内置",
55
"babel-loader-description": "内部使用 SWC 实现了 babel-loader 的大部分转换功能",
66
"babel-loader-remark": "babel-loader 对性能影响较大,请谨慎使用",
7-
"html-webpack-plugin-desc": "在 v0.3.3 已实现对该插件的支持,请升级 Rspack 版本来使用",
8-
"sentry_webpack-plugin-desc": "在 v0.3.3 已实现对该插件 v1.20.1 以上版本的支持",
7+
"sentry_webpack-plugin-desc": "支持该插件 >= v1.20.1 版本",
98
"copy-plugin-desc": "使用 [CopyRspackPlugin](/plugins/rspack/copy-rspack-plugin) 替代",
109
"mini-css-extract-plugin-desc": "使用 [CssExtractRspackPlugin](/plugins/rspack/css-extract-rspack-plugin) 替代",
1110
"terser-webpack-plugin-desc": "Rspack 提供 [SwcJsMinimizerRspackPlugin](/plugins/rspack/swc-js-minimizer-rspack-plugin) 以带来更好的性能",
@@ -24,8 +23,9 @@
2423
"webpack-filter-warnings-plugin-desc": "使用 [ignoreWarnings](/config/other-options#ignorewarnings) 替代",
2524
"speed-measure-webpack-plugin-desc": "使用 [Rsdoctor](/guide/optimization/use-rsdoctor) 替代",
2625
"eslint-webpack-plugin-desc": "使用 [eslint-rspack-plugin](https://github.com/rspack-contrib/eslint-rspack-plugin) 替代",
27-
"circular-dependency-plugin-desc": "使用 Eslint [import/no-cycle](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-cycle.md) 规则替代",
26+
"circular-dependency-plugin-desc": "使用 ESLint [import/no-cycle](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-cycle.md) 规则替代",
2827
"html-webpack-tags-plugin-desc": "使用 [html-rspack-tags-plugin](https://github.com/rspack-contrib/html-rspack-tags-plugin) 替代",
2928
"needs-html-webpack-plugin": "该插件依赖了 html-webpack-plugin",
30-
"webpack-assets-manifest-desc": "仅支持基础用法"
29+
"webpack-assets-manifest-desc": "仅支持基础用法",
30+
"fork-ts-checker-webpack-plugin-desc": "使用 [ts-checker-rspack-plugin](https://github.com/rspack-contrib/ts-checker-rspack-plugin) 替代"
3131
}

website/docs/en/config/plugins.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ Rspack strives to maintain compatibility with the webpack plugin ecosystem to le
2222

2323
```js title=rspack.config.js
2424
const rspack = require('@rspack/core');
25-
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
25+
const HtmlWebpackPlugin = require('html-webpack-plugin');
2626

2727
module.exports = {
2828
//...
29-
plugins: [new ForkTsCheckerWebpackPlugin()],
29+
plugins: [new HtmlWebpackPlugin()],
3030
};
3131
```

website/docs/en/guide/migration/webpack.mdx

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ Now you can remove the webpack-related dependencies from your project:
2222
<PackageManagerTabs command="remove webpack webpack-cli webpack-dev-server" />
2323

2424
:::tip
25-
In some cases, you will still need to keep `webpack` as a dev dependency, such as when using [vue-loader](https://github.com/vuejs/vue-loader) or [fork-ts-checker-webpack-plugin](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin).
25+
In some cases, you will still need to keep `webpack` as a dev dependency, such as when using [vue-loader](https://github.com/vuejs/vue-loader).
2626

27-
This is because these plugins directly `import` subpaths of webpack and couple with webpack. If you encounter this issue, you can provide feedback to the maintainers of these plugins, asking them if they can make `webpack` an optional dependency.
27+
This is because these packages directly `import` subpaths of webpack and couple with webpack. If you encounter this issue, you can provide feedback to the maintainers of these plugins, asking them if they can make `webpack` an optional dependency.
2828
:::
2929

3030
## Updating package.json
@@ -101,7 +101,9 @@ Rspack supports most of the webpack community plugins and also offers alternativ
101101

102102
Check [Plugin compat](/guide/compatibility/plugin) for more information on Rspack's compatibility with popular webpack community plugins.
103103

104-
### [copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin)[rspack.CopyRspackPlugin](/plugins/rspack/copy-rspack-plugin)
104+
### `copy-webpack-plugin`
105+
106+
Use [rspack.CopyRspackPlugin](/plugins/rspack/copy-rspack-plugin) instead of [copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin):
105107

106108
```diff title="rspack.config.js"
107109
- const CopyWebpackPlugin = require('copy-webpack-plugin');
@@ -117,7 +119,9 @@ module.exports = {
117119
}
118120
```
119121

120-
### [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin)[rspack.CssExtractRspackPlugin](/plugins/rspack/css-extract-rspack-plugin)
122+
### `mini-css-extract-plugin`
123+
124+
Use [rspack.CssExtractRspackPlugin](/plugins/rspack/css-extract-rspack-plugin) instead of [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin):
121125

122126
```diff title="rspack.config.js"
123127
- const CssExtractWebpackPlugin = require('mini-css-extract-plugin');
@@ -135,18 +139,20 @@ module.exports = {
135139
{
136140
test: /\.css$/i,
137141
use: [
138-
- CssExtractWebpackPlugin.loader,
139-
+ rspack.CssExtractRspackPlugin.loader,
142+
- CssExtractWebpackPlugin.loader,
143+
+ rspack.CssExtractRspackPlugin.loader,
140144
"css-loader"
141145
],
142-
+ type: 'javascript/auto'
146+
+ type: 'javascript/auto'
143147
}
144148
]
145149
}
146150
}
147151
```
148152

149-
### [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin)[resolve.tsConfig](/config/resolve#resolvetsconfig)
153+
### `tsconfig-paths-webpack-plugin`
154+
155+
Use [resolve.tsConfig](/config/resolve#resolvetsconfig) instead of [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin):
150156

151157
```diff title="rspack.config.js"
152158
- const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
@@ -159,6 +165,22 @@ module.exports = {
159165
}
160166
```
161167

168+
### `fork-ts-checker-webpack-plugin`
169+
170+
Use [ts-checker-rspack-plugin](https://github.com/rspack-contrib/ts-checker-rspack-plugin) instead of [fork-ts-checker-webpack-plugin](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin):
171+
172+
```diff title="rspack.config.js"
173+
- const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
174+
+ const { TsCheckerRspackPlugin } = require('ts-checker-rspack-plugin');
175+
176+
module.exports = {
177+
plugins: [
178+
- new ForkTsCheckerWebpackPlugin()
179+
+ new TsCheckerRspackPlugin()
180+
]
181+
}
182+
```
183+
162184
## Loaders
163185

164186
Rspack's loader runner is fully compatible with webpack's loader functionality, supporting the vast majority of webpack loaders.

website/docs/en/guide/tech/typescript.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ To maximize parallelism, `builtin:swc-loader` will transpile each module separat
4444

4545
## TypeCheck
4646

47-
You can use the [fork-ts-checker-webpack-plugin](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin) to perform TypeScript type checking during compilation. However, it's important to note that TypeScript's type checking can be time-consuming, especially for larger projects. This means that the time required for type checking may exceed the build time of Rspack itself.
47+
You can use the [ts-checker-rspack-plugin](https://github.com/rspack-contrib/ts-checker-rspack-plugin) to perform TypeScript type checking during compilation. However, it's important to note that TypeScript's type checking can be time-consuming, especially for larger projects. This means that the time required for type checking may exceed the build time of Rspack itself.
4848

4949
If you are using the plugin in development mode, it won't block the build and you can continue with the build process. However, in build mode, the plugin will block the build until the type checking is complete which may lead to longer build times.
5050

5151
Based on your actual needs, you should decide whether to enable this plugin. If the type checking process becomes a bottleneck in your build process, we recommend using TypeScript's incremental build feature. This feature can greatly speed up the type checking process by only analyzing the changed files since the last build.
5252

53-
To enable TypeScript's incremental build, you can use `tsc --incremental` independently or [enabling incremental mode](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin#enabling-incremental-mode) in the plugin.
53+
To enable TypeScript's incremental build, you can use `tsc --incremental` independently or [enabling incremental mode](https://github.com/rspack-contrib/ts-checker-rspack-plugin#enabling-incremental-mode) in the plugin.
5454

5555
Enabling incremental build can help reduce type checking time, especially when only a few files have been modified. This way, you can optimize your build process without sacrificing the benefits of type checking.
5656

website/docs/zh/config/plugins.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ Rspack 致力于兼容 webpack 生态下的插件,以使用社区中已经积
2222

2323
```js title=rspack.config.js
2424
const rspack = require('@rspack/core');
25-
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
25+
const HtmlWebpackPlugin = require('html-webpack-plugin');
2626

2727
module.exports = {
2828
//...
29-
plugins: [new ForkTsCheckerWebpackPlugin()],
29+
plugins: [new HtmlWebpackPlugin()],
3030
};
3131
```

website/docs/zh/guide/migration/webpack.mdx

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Rspack 的配置是基于 webpack 的设计实现的,以此你能够非常轻
2121
<PackageManagerTabs command="remove webpack webpack-cli webpack-dev-server" />
2222

2323
:::tip
24-
在个别情况下,你仍然需要保留 `webpack` 作为开发依赖,例如使用 [vue-loader](https://github.com/vuejs/vue-loader) [fork-ts-checker-webpack-plugin](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin) 时。
24+
在个别情况下,你仍然需要保留 `webpack` 作为开发依赖,例如使用 [vue-loader](https://github.com/vuejs/vue-loader) 时。
2525

26-
这是因为这些插件直接 `import` 了 webpack 的子路径,与 webpack 产生了耦合。如果你遇到了这种情况,可以向这些插件的维护者反馈,询问他们能否将 `webpack` 作为可选依赖。
26+
这是因为这些库直接 `import` 了 webpack 的子路径,与 webpack 产生了耦合。如果你遇到了这种情况,可以向这些插件的维护者反馈,询问他们能否将 `webpack` 作为可选依赖。
2727
:::
2828

2929
## 修改 package.json
@@ -96,9 +96,11 @@ module.exports = {
9696

9797
Rspack 支持大部分 webpack 社区插件,并为暂不支持的插件提供了替代方案。
9898

99-
查看[Plugin 兼容](/guide/compatibility/plugin)以了解 Rspack 对 webpack 常见社区插件的兼容情况。
99+
查看 [Plugin 兼容](/guide/compatibility/plugin) 以了解 Rspack 对 webpack 常见社区插件的兼容情况。
100100

101-
### [copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin)[rspack.CopyRspackPlugin](/plugins/rspack/copy-rspack-plugin)
101+
### `copy-webpack-plugin`
102+
103+
使用 [rspack.CopyRspackPlugin](/plugins/rspack/copy-rspack-plugin) 代替 [copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin)
102104

103105
```diff title="rspack.config.js"
104106
- const CopyWebpackPlugin = require('copy-webpack-plugin');
@@ -114,7 +116,9 @@ module.exports = {
114116
}
115117
```
116118

117-
### [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin)[rspack.CssExtractRspackPlugin](/plugins/rspack/css-extract-rspack-plugin)
119+
### `mini-css-extract-plugin`
120+
121+
使用 [rspack.CssExtractRspackPlugin](/plugins/rspack/css-extract-rspack-plugin) 代替 [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin)
118122

119123
```diff title="rspack.config.js"
120124
- const CssExtractWebpackPlugin = require('mini-css-extract-plugin');
@@ -132,18 +136,20 @@ module.exports = {
132136
{
133137
test: /\.css$/i,
134138
use: [
135-
- CssExtractWebpackPlugin.loader,
136-
+ rspack.CssExtractRspackPlugin.loader,
139+
- CssExtractWebpackPlugin.loader,
140+
+ rspack.CssExtractRspackPlugin.loader,
137141
"css-loader"
138142
],
139-
+ type: 'javascript/auto'
143+
+ type: 'javascript/auto'
140144
}
141145
]
142146
}
143147
}
144148
```
145149

146-
### [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin)[resolve.tsConfig](/config/resolve#resolvetsconfig)
150+
### `tsconfig-paths-webpack-plugin`
151+
152+
使用 [resolve.tsConfig](/config/resolve#resolvetsconfig) 代替 [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin)
147153

148154
```diff title="rspack.config.js"
149155
- const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
@@ -156,6 +162,22 @@ module.exports = {
156162
}
157163
```
158164

165+
### `fork-ts-checker-webpack-plugin`
166+
167+
使用 [ts-checker-rspack-plugin](https://github.com/rspack-contrib/ts-checker-rspack-plugin) 代替 [fork-ts-checker-webpack-plugin](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin)
168+
169+
```diff title="rspack.config.js"
170+
- const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
171+
+ const { TsCheckerRspackPlugin } = require('ts-checker-rspack-plugin');
172+
173+
module.exports = {
174+
plugins: [
175+
- new ForkTsCheckerWebpackPlugin()
176+
+ new TsCheckerRspackPlugin()
177+
]
178+
}
179+
```
180+
159181
## Loader
160182

161183
Rspack 已实现了与 Webpack 功能完全对齐的 loader 执行器,支持绝大多数 webpack loader,因此你可以直接使用现有的 loader 而无需修改。不过,为了获得最佳性能,我们仍建议进行以下迁移:

website/docs/zh/guide/tech/typescript.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ module.exports = {
4545

4646
## 类型检查
4747

48-
你可以使用 [fork-ts-checker-webpack-plugin](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin) 在编译过程中执行 TypeScript 类型检查。然而,需要注意的是,特别是对于较大的项目,TypeScript 的类型检查可能非常耗时。这意味着类型检查所需的时间可能超过 Rspack 本身的构建时间。
48+
你可以使用 [ts-checker-rspack-plugin](https://github.com/rspack-contrib/ts-checker-rspack-plugin) 在编译过程中执行 TypeScript 类型检查。然而,需要注意的是,特别是对于较大的项目,TypeScript 的类型检查可能非常耗时。这意味着类型检查所需的时间可能超过 Rspack 本身的构建时间。
4949

5050
如果你在开发模式下使用该插件,它将不会阻塞构建过程,你可以继续进行构建。但是,在构建模式下,该插件将会阻塞构建,直到类型检查完成,所以可能会导致构建时间变长。
5151

5252
根据你的实际需求,你应该决定是否启用该插件。如果类型检查过程成为构建过程的瓶颈,我们建议使用 TypeScript 的增量构建功能。该功能可以通过仅分析自上次构建以来修改的文件来大大加快类型检查的速度。
5353

54-
要启用 TypeScript 的增量构建,你可以在独立使用 `tsc --incremental` 或者在插件里[使用 incremental mode](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin#enabling-incremental-mode)
54+
要启用 TypeScript 的增量构建,你可以在独立使用 `tsc --incremental` 或者在插件里[使用 incremental mode](https://github.com/rspack-contrib/ts-checker-rspack-plugin#enabling-incremental-mode)
5555

5656
启用增量构建可以帮助减少类型检查的时间,特别是当只有少数文件被修改时。这样,你可以在优化构建过程的同时,不会损失类型检查的好处。
5757

0 commit comments

Comments
 (0)