diff --git a/website/docs/en/plugins/dev/core.mdx b/website/docs/en/plugins/dev/core.mdx index 5fd6c1318b..e45f8faf61 100644 --- a/website/docs/en/plugins/dev/core.mdx +++ b/website/docs/en/plugins/dev/core.mdx @@ -354,9 +354,9 @@ The `handler` function provides the following params: - `code`: The code of the module. - `context`: The directory path of the currently processed module. The same as Rspack loader's [this.context](https://rspack.rs/api/loader-api/context#thiscontext). - `resolve`: Resolve a module specifier. The same as Rspack loader's [this.resolve](https://rspack.rs/api/loader-api/context#thisresolve). -- `resource`: The absolute path of the module, including the query. -- `resourcePath`: The absolute path of the module, without the query. -- `resourceQuery`: The query of the module. +- `resource`: The absolute path of the module, including the query. The same as Rspack loader's [this.resource](https://rspack.rs/api/loader-api/context#thisresource). +- `resourcePath`: The absolute path of the module, without the query. The same as Rspack loader's [this.resourcePath](https://rspack.rs/api/loader-api/context#thisresourcepath). +- `resourceQuery`: The query of the module. The same as Rspack loader's [this.resourceQuery](https://rspack.rs/api/loader-api/context#thisresourcequery). - `environment`: The [environment context](/api/javascript-api/environment-api#environment-context) for current build. - `addDependency`: Add an additional file as the dependency. The file will be watched and changes to the file will trigger rebuild. The same as Rspack loader's [this.addDependency](https://rspack.rs/api/loader-api/context#thisadddependency). - `addMissingDependency`: Add an non-existing file as the dependency. The file will be watched and changes to the file will trigger rebuild. The same as Rspack loader's [this.addMissingDependency](https://rspack.rs/api/loader-api/context#thisaddmissingdependency). diff --git a/website/docs/zh/plugins/dev/core.mdx b/website/docs/zh/plugins/dev/core.mdx index c36c765e51..1354b34c06 100644 --- a/website/docs/zh/plugins/dev/core.mdx +++ b/website/docs/zh/plugins/dev/core.mdx @@ -350,11 +350,11 @@ type TransformHandler = ( handler 函数提供以下参数: - `code`:模块的代码。 -- `context`:当前被处理的模块所在的目录路径。与 Rspack loader 的 [this.context](https://rspack.rs/zh/api/loader-api/context#thiscontext) 相同。 +- `context`:当前被处理的模块所在的目录路径,与 Rspack loader 的 [this.context](https://rspack.rs/zh/api/loader-api/context#thiscontext) 相同。 - `resolve`:解析一个模块标识符。与 Rspack loader 的 [this.resolve](https://rspack.rs/zh/api/loader-api/context#thisresolve) 相同。 -- `resource`:模块的绝对路径,包含 query。 -- `resourcePath`:模块的绝对路径,不包含 query。 -- `resourceQuery`:模块路径上的 query。 +- `resource`:模块的绝对路径,包含 query,与 Rspack loader 的 [this.resource](https://rspack.rs/zh/api/loader-api/context#thisresource) 相同。 +- `resourcePath`:模块的绝对路径,不包含 query,与 Rspack loader 的 [this.resourcePath](https://rspack.rs/zh/api/loader-api/context#thisresourcepath) 相同。 +- `resourceQuery`:模块路径上的 query,与 Rspack loader 的 [this.resourceQuery](https://rspack.rs/zh/api/loader-api/context#thisresourcequery) 相同。 - `environment`: 当前构建的 [environment 上下文](/api/javascript-api/environment-api#environment-context). - `addDependency`:添加一个额外的文件作为依赖。该文件将被监听,并在发生变更时触发重新构建。与 Rspack loader 的 [this.addDependency](https://rspack.rs/zh/api/loader-api/context#thisadddependency) 相同。 - `addMissingDependency`:添加一个不存在的文件作为依赖。该文件将被监听,并在发生变更时触发重新构建。与 Rspack loader 的 [this.addMissingDependency](https://rspack.rs/zh/api/loader-api/context#thisaddmissingdependency) 相同。