From 14948abdbc22bbaaa2657a342089859a234c55a2 Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 19 Apr 2024 17:15:28 +0800 Subject: [PATCH] docs: fix all broken plugin links --- website/cspell.config.cjs | 1 + website/docs/en/blog/announcing-0.4.mdx | 10 +++++----- website/docs/en/config/builtins.mdx | 14 +++++++------- website/docs/en/config/optimization.mdx | 4 ++-- website/docs/en/guide/module-federation.mdx | 4 ++-- website/docs/zh/blog/announcing-0.4.mdx | 10 +++++----- website/docs/zh/config/builtins.mdx | 14 +++++++------- website/docs/zh/config/optimization.mdx | 4 ++-- website/docs/zh/guide/module-federation.mdx | 4 ++-- 9 files changed, 33 insertions(+), 32 deletions(-) diff --git a/website/cspell.config.cjs b/website/cspell.config.cjs index 64065b328876..365c80927b8a 100644 --- a/website/cspell.config.cjs +++ b/website/cspell.config.cjs @@ -19,6 +19,7 @@ module.exports = { 'package.json', 'pnpm-lock.yaml', 'rspack.mp3', + 'doc_build', ], flagWords: banWords, caseSensitive: true, diff --git a/website/docs/en/blog/announcing-0.4.mdx b/website/docs/en/blog/announcing-0.4.mdx index f3421fb90fcd..2d7b9b7c1724 100644 --- a/website/docs/en/blog/announcing-0.4.mdx +++ b/website/docs/en/blog/announcing-0.4.mdx @@ -280,7 +280,7 @@ But we suggest you use `builtin:swc-loader` to transform files now. More details ### Migrating builtin options to builtin plugins -In v0.4.0, Rspack deprecated some of the builtin options and migrated them to [internal plugins](/config/plugins.html#internal-plugins). +In v0.4.0, Rspack deprecated some of the builtin options and migrated them to [builtin plugins](/config/plugins). Currently, Rspack's internal plugins are divided into two categories: @@ -301,7 +301,7 @@ module.exports = { } ``` -For `builtins.html`, it can be directly migrated to [HtmlRspackPlugin](/config/plugins.html#htmlrspackplugin): +For `builtins.html`, it can be directly migrated to [HtmlRspackPlugin](/plugins/rspack/html-rspack-plugin): ```diff + const rspack = require("@rspack/core") @@ -327,9 +327,9 @@ module.exports = { }; ``` -For `builtins.copy`, it can be directly migrated to [CopyRspackPlugin](/config/plugins.html#copyrspackplugin). +For `builtins.copy`, it can be directly migrated to [CopyRspackPlugin](/plugins/rspack/copy-rspack-plugin). -For the original `builtins.minifyOptions`, we provide [SwcJsMinimizerRspackPlugin](/config/plugins.html#swcjsminimizerrspackplugin): +For the original `builtins.minifyOptions`, we provide [SwcJsMinimizerRspackPlugin](/plugins/rspack/swc-js-minimizer-rspack-plugin): ```js const rspack = require('@rspack/core'); @@ -344,4 +344,4 @@ module.exports = { }; ``` -Other builtin options can be directly referred to the rspack [internal plugins](/config/plugins.html#internal-plugins) for migration, or completed according to the CLI prompts after upgrading to v0.4.0. +Other builtin options can be directly referred to the rspack [builtin plugins](/config/plugins) for migration, or completed according to the CLI prompts after upgrading to v0.4.0. diff --git a/website/docs/en/config/builtins.mdx b/website/docs/en/config/builtins.mdx index 11b1eb866289..81f275e4f940 100644 --- a/website/docs/en/config/builtins.mdx +++ b/website/docs/en/config/builtins.mdx @@ -24,7 +24,7 @@ The built-in functionality provided by _builtins_ may change in the future or be /> :::warning -Please migrate to [`BannerPlugin`](/config/plugins.html#bannerplugin). +Please migrate to [`BannerPlugin`](/plugins/webpack/banner-plugin). ::: - **Type:** @@ -244,7 +244,7 @@ module.exports = { /> :::warning -Please migrate to [`HtmlRspackPlugin`](/config/plugins.html#htmlrspackplugin). +Please migrate to [`HtmlRspackPlugin`](/plugins/rspack/html-rspack-plugin). ::: This configuration simplifies creation of HTML files to serve your Rspack bundles. @@ -302,7 +302,7 @@ If the configuration options provided by `rspack.HtmlRspackPlugin` cannot meet y /> :::warning -Please migrate to [`SwcJsMinimizerRspackPlugin`](/config/plugins.html#swcjsminimizerrspackplugin). +Please migrate to [`SwcJsMinimizerRspackPlugin`](/plugins/rspack/swc-js-minimizer-rspack-plugin). ::: Set built-in minimizer options. @@ -342,7 +342,7 @@ type BuiltinsMinifyOptions = { /> :::warning -Please migrate to [`DefinePlugin`](/config/plugins.html#defineplugin). +Please migrate to [`DefinePlugin`](/plugins/webpack/define-plugin). ::: Replaces variables in your code with other values or expressions at compile time. @@ -520,7 +520,7 @@ type BuiltinsCssModules = { /> :::warning -Please migrate to [`ProgressPlugin`](/config/plugins.html#progressplugin). +Please migrate to [`ProgressPlugin`](/plugins/webpack/progress-plugin). ::: This configuration can be used to control progress, `false` means to turn off progress. @@ -562,7 +562,7 @@ Whether to enable the development-friendly split chunks algorithm. /> :::warning -Please migrate to [`CopyRspackPlugin`](/config/plugins.html#copyrspackplugin). +Please migrate to [`CopyRspackPlugin`](/plugins/rspack/copy-rspack-plugin). ::: import WebpackLicense from '../../../components/webpack-license'; @@ -818,7 +818,7 @@ import 'antd/es/button/style'; /> :::warning -Please migrate to [`ProvidePlugin`](/config/plugins.html#provideplugin). +Please migrate to [`ProvidePlugin`](/plugins/webpack/provide-plugin). ::: Automatically load modules instead of having to import or require them everywhere. diff --git a/website/docs/en/config/optimization.mdx b/website/docs/en/config/optimization.mdx index c0cd027d33d1..b17adc270867 100644 --- a/website/docs/en/config/optimization.mdx +++ b/website/docs/en/config/optimization.mdx @@ -61,8 +61,8 @@ If you are encountering performance issue, and you are using `optimization.split ]} /> -Customize the minimizer. By default, [`rspack.SwcJsMinimizerRspackPlugin`](/config/plugins.html#swcjsminimizerrspackplugin) -and [`rspack.SwcCssMinimizerRspackPlugin`](/config/plugins.html#swccssminimizerrspackplugin) are used. +Customize the minimizer. By default, [`rspack.SwcJsMinimizerRspackPlugin`](/plugins/rspack/swc-js-minimizer-rspack-plugin) +and [`rspack.SwcCssMinimizerRspackPlugin`](/plugins/rspack/swc-css-minimizer-rspack-plugin) are used. When `optimization.minimizer` is specified, the default minimizers will be disabled. ```js title=rspack.config.js diff --git a/website/docs/en/guide/module-federation.mdx b/website/docs/en/guide/module-federation.mdx index 5f91834e4447..d3ac5d64d4a5 100644 --- a/website/docs/en/guide/module-federation.mdx +++ b/website/docs/en/guide/module-federation.mdx @@ -18,5 +18,5 @@ Rspack supports two versions of Module Federation: Module Federation 1.0 and Mod Detailed configuration can be found in: -- [ModuleFederationPlugin](/config/plugins.html#containermodulefederationplugin) -- [ModuleFederationPluginV1](/config/plugins.html#containermodulefederationpluginv1) +- [ModuleFederationPlugin](/plugins/webpack/module-federation-plugin) +- [ModuleFederationPluginV1](/plugins/webpack/module-federation-plugin-v1) diff --git a/website/docs/zh/blog/announcing-0.4.mdx b/website/docs/zh/blog/announcing-0.4.mdx index 244705a088ce..27333c438c15 100644 --- a/website/docs/zh/blog/announcing-0.4.mdx +++ b/website/docs/zh/blog/announcing-0.4.mdx @@ -264,7 +264,7 @@ module.exports = { ### 迁移 builtin options 到 builtin plugins -Rspack 在 v0.4.0 中废弃了部分 builtin options 并迁移至 rspack [内部插件](/config/plugins.html#%E5%86%85%E9%83%A8%E6%8F%92%E4%BB%B6)。 +Rspack 在 v0.4.0 中废弃了部分 builtin options 并迁移至 rspack [内部插件](/config/plugins)。 目前,rspack 的内部插件分为两类: @@ -285,7 +285,7 @@ module.exports = { } ``` -对于 `builtins.html` 可以直接迁移到 [HtmlRspackPlugin](/config/plugins.html#htmlrspackplugin): +对于 `builtins.html` 可以直接迁移到 [HtmlRspackPlugin](/plugins/rspack/html-rspack-plugin): ```diff + const rspack = require("@rspack/core") @@ -311,9 +311,9 @@ module.exports = { }; ``` -对于 `builtins.copy` 可以直接迁移到 [CopyRspackPlugin](/config/plugins.html#copyrspackplugin)。 +对于 `builtins.copy` 可以直接迁移到 [CopyRspackPlugin](/plugins/rspack/copy-rspack-plugin)。 -原先的 `builtins.minifyOptions` 我们提供了 [SwcJsMinimizerRspackPlugin](/config/plugins.html#swcjsminimizerrspackplugin): +原先的 `builtins.minifyOptions` 我们提供了 [SwcJsMinimizerRspackPlugin](/plugins/rspack/swc-js-minimizer-rspack-plugin): ```js const rspack = require('@rspack/core'); @@ -328,4 +328,4 @@ module.exports = { }; ``` -其他内容可以直接参考 rspack [内部插件](/config/plugins.html#%E5%86%85%E9%83%A8%E6%8F%92%E4%BB%B6)进行迁移,也可以在升级到 v0.4.0 后根据 CLI 提示完成操作。 +其他内容可以直接参考 rspack [内部插件](/config/plugins)进行迁移,也可以在升级到 v0.4.0 后根据 CLI 提示完成操作。 diff --git a/website/docs/zh/config/builtins.mdx b/website/docs/zh/config/builtins.mdx index af5caa1eaf92..05722eadae51 100644 --- a/website/docs/zh/config/builtins.mdx +++ b/website/docs/zh/config/builtins.mdx @@ -26,7 +26,7 @@ _Builtins_ 提供的内置功能在未来可能会发生变化,或被更好的 /> :::warning -请迁移至 [`BannerPlugin`](/config/plugins.html#bannerplugin)。 +请迁移至 [`BannerPlugin`](/plugins/webpack/banner-plugin)。 ::: - **类型:** @@ -341,7 +341,7 @@ module.exports = { /> :::warning -请迁移至 [`HtmlRspackPlugin`](/config/plugins.html#htmlrspackplugin)。 +请迁移至 [`HtmlRspackPlugin`](/plugins/rspack/html-rspack-plugin)。 ::: 该配置可以快速创建与 Rspack 产物关联的 HTML 文件。 @@ -490,7 +490,7 @@ type BuiltinsHtml = Array<{ /> :::warning -请迁移至 [`SwcJsMinimizerRspackPlugin`](/config/plugins.html#swcjsminimizerrspackplugin)。 +请迁移至 [`SwcJsMinimizerRspackPlugin`](/plugins/rspack/swc-js-minimizer-rspack-plugin)。 ::: 设置内置压缩器配置。 @@ -593,7 +593,7 @@ type BuiltinsMinifyOptions = { /> :::warning -请迁移至 [`DefinePlugin`](/config/plugins.html#defineplugin)。 +请迁移至 [`DefinePlugin`](/plugins/webpack/define-plugin)。 ::: 此选项将会在编译时将代码中的变量替换为其他值或表达式。 @@ -906,7 +906,7 @@ type BuiltinsCssModules = { /> :::warning -请迁移至 [`ProgressPlugin`](/config/plugins.html#progressplugin)。 +请迁移至 [`ProgressPlugin`](/plugins/webpack/progress-plugin)。 ::: 此选项可以用来配置进度条,false 表示不显示进度条。 @@ -973,7 +973,7 @@ type BuiltinsCssModules = { /> :::warning -请迁移至 [`CopyRspackPlugin`](/config/plugins.html#copyrspackplugin)。 +请迁移至 [`CopyRspackPlugin`](/plugins/rspack/copy-rspack-plugin)。 ::: import WebpackLicense from '../../../components/webpack-license'; @@ -1296,7 +1296,7 @@ import 'antd/es/button/style'; /> :::warning -请迁移至 [`ProvidePlugin`](/config/plugins.html#provideplugin)。 +请迁移至 [`ProvidePlugin`](/plugins/webpack/provide-plugin)。 ::: 自动的将全局变量转换为模块导入,如下配置: diff --git a/website/docs/zh/config/optimization.mdx b/website/docs/zh/config/optimization.mdx index 18061396af24..1a128120af19 100644 --- a/website/docs/zh/config/optimization.mdx +++ b/website/docs/zh/config/optimization.mdx @@ -61,8 +61,8 @@ import WebpackLicense from '../../../components/webpack-license'; ]} /> -自定义压缩器。默认使用 [`rspack.SwcJsMinimizerRspackPlugin`](/config/plugins.html#swcjsminimizerrspackplugin) -和 [`rspack.SwcCssMinimizerRspackPlugin`](/config/plugins.html#swccssminimizerrspackplugin)。当声明了 `optimization.minimizer`,默认压缩器会被禁用。 +自定义压缩器。默认使用 [`rspack.SwcJsMinimizerRspackPlugin`](/plugins/rspack/swc-js-minimizer-rspack-plugin) +和 [`rspack.SwcCssMinimizerRspackPlugin`](/plugins/rspack/swc-css-minimizer-rspack-plugin)。当声明了 `optimization.minimizer`,默认压缩器会被禁用。 ```js title=rspack.config.js const minifyPlugin = require('@rspack/plugin-minify'); diff --git a/website/docs/zh/guide/module-federation.mdx b/website/docs/zh/guide/module-federation.mdx index 77d284c2f977..aa508a2eda1b 100644 --- a/website/docs/zh/guide/module-federation.mdx +++ b/website/docs/zh/guide/module-federation.mdx @@ -19,5 +19,5 @@ Rspack 支持两个版本的模块联邦:模块联邦 1.0 和模块联邦 1.5 详细配置可参考: -- [ModuleFederationPlugin](/config/plugins.html#containermodulefederationplugin) -- [ModuleFederationPluginV1](/config/plugins.html#containermodulefederationpluginv1) +- [ModuleFederationPlugin](/plugins/webpack/module-federation-plugin) +- [ModuleFederationPluginV1](/plugins/webpack/module-federation-plugin-v1)