Skip to content

Commit

Permalink
docs: link to Rspack document instead of webpack (#3135)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Aug 5, 2024
1 parent d564e6c commit 9bb7e96
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/plugins/swc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export const pluginSwc = (): RsbuildPlugin => ({
/**
* If a script is imported with data URI, it can be compiled by babel too.
* This is used by some frameworks to create virtual entry.
* https://webpack.js.org/api/module-methods/#import
* https://rspack.dev/api/runtime-api/module-methods#import
* @example: import x from 'data:text/javascript,export default 1;';
*/
dataUriRule.resolve
Expand Down
2 changes: 1 addition & 1 deletion website/docs/en/config/security/nonce.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The `security.nonce` config adds the nonce attribute to the following tags:

- All `<script>` tags generated by Rsbuild
- All `<style>` tags generated by Rsbuild
- Dynamic `<script>` tags generated by Rspack (implemented by the [\_\_webpack_nonce\_\_](https://webpack.js.org/guides/csp/) variable)
- Dynamic `<script>` tags generated by Rspack (implemented by the [\_\_webpack_nonce\_\_](https://rspack.dev/api/runtime-api/module-variables#__webpack_nonce__) variable)

For `<script>` or `<style>` tags that already exist in the HTML template file, Rsbuild will not modify them. You can directly add the `nonce` attribute in the template.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/en/shared/onAfterBuild.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
`onAfterBuild` is a callback function that is triggered after running the production build. You can access the build result information via the [stats](https://webpack.js.org/api/node/#stats-object) parameter.
`onAfterBuild` is a callback function that is triggered after running the production build. You can access the build result information via the [stats](https://rspack.dev/api/javascript-api/stats) parameter.

Moreover, you can use `isWatch` to determine whether it is watch mode, and use `isFirstCompile` to determine whether it is the first build on watch mode.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/en/shared/onAfterCreateCompiler.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
`onAfterCreateCompiler` is a callback function that is triggered after the compiler instance has been created, but before the build process. This hook is called when you run `rsbuild.startDevServer`, `rsbuild.build`, or `rsbuild.createCompiler`.

You can access the [Compiler instance](https://webpack.js.org/api/node/#compiler-instance) through the `compiler` parameter:
You can access the [Compiler instance](https://rspack.dev/api/javascript-api/compiler) through the `compiler` parameter:

- **Type:**

Expand Down
2 changes: 1 addition & 1 deletion website/docs/en/shared/onAfterEnvironmentCompile.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
`onAfterEnvironmentCompile` is a callback function that is triggered after the compilation of a single environment. You can access the build result information via the [stats](https://webpack.js.org/api/node/#stats-object) parameter.
`onAfterEnvironmentCompile` is a callback function that is triggered after the compilation of a single environment. You can access the build result information via the [stats](https://rspack.dev/api/javascript-api/stats) parameter.

Moreover, you can use `isWatch` to determine whether it is dev or build watch mode, and use `isFirstCompile` to determine whether it is the first build.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/zh/config/security/nonce.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default {

- 由 Rsbuild 生成的所有 `<script>` 标签
- 由 Rsbuild 生成的所有 `<style>` 标签
- 由 Rspack 动态生成的 `<script>` 标签(通过 [\_\_webpack_nonce\_\_](https://webpack.js.org/guides/csp/) 变量实现)
- 由 Rspack 动态生成的 `<script>` 标签(通过 [\_\_webpack_nonce\_\_](https://rspack.dev/api/runtime-api/module-variables#__webpack_nonce__) 变量实现)

对于 HTML 模板文件中已存在的 `<script>``<style>` 标签,Rsbuild 不会对其进行修改,你可以直接在模板中添加 `nonce` 属性。

Expand Down
2 changes: 1 addition & 1 deletion website/docs/zh/shared/onAfterBuild.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
`onAfterBuild` 是在执行生产环境构建后触发的回调函数,你可以通过 [stats](https://webpack.js.org/api/node/#stats-object) 参数获取到构建结果信息。
`onAfterBuild` 是在执行生产环境构建后触发的回调函数,你可以通过 [stats](https://rspack.dev/api/javascript-api/stats) 参数获取到构建结果信息。

另外,你可以通过 `isWatch` 判断是否是 watch 模式,并在 watch 模式下通过 `isFirstCompile` 来判断是否为首次构建。

Expand Down
2 changes: 1 addition & 1 deletion website/docs/zh/shared/onAfterCreateCompiler.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
`onAfterCreateCompiler` 是在创建 Compiler 实例后、执行构建前触发的回调函数,当你执行 `rsbuild.startDevServer``rsbuild.build``rsbuild.createCompiler` 时,都会调用此钩子。

你可以通过 `compiler` 参数获取到 [Compiler 实例对象](https://webpack.js.org/api/node/#compiler-instance):
你可以通过 `compiler` 参数获取到 [Compiler 实例对象](https://rspack.dev/api/javascript-api/compiler):

- **类型:**

Expand Down
2 changes: 1 addition & 1 deletion website/docs/zh/shared/onAfterEnvironmentCompile.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
`onAfterEnvironmentCompile` 是在执行单个 environment 的构建后触发的回调函数,你可以通过 [stats](https://webpack.js.org/api/node/#stats-object) 参数获取到构建结果信息。
`onAfterEnvironmentCompile` 是在执行单个 environment 的构建后触发的回调函数,你可以通过 [stats](https://rspack.dev/api/javascript-api/stats) 参数获取到构建结果信息。

另外,你可以通过 `isWatch` 判断是否是 dev 或者 build watch 模式,并通过 `isFirstCompile` 来判断是否为首次构建。

Expand Down

0 comments on commit 9bb7e96

Please sign in to comment.