diff --git a/docs/guide/index.md b/docs/guide/index.md index dcb93b5d..6e0fd129 100644 --- a/docs/guide/index.md +++ b/docs/guide/index.md @@ -198,9 +198,9 @@ export default defineConfig({ | [`enforce`](https://vite.dev/guide/api-plugin.html#plugin-ordering) | ❌ 1 | ✅ | ✅ | ❌ 1 | ✅ | ✅ | ✅ | | [`buildStart`](https://rollupjs.org/plugin-development/#buildstart) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | [`resolveId`](https://rollupjs.org/plugin-development/#resolveid) | ✅ | ✅ | ✅ | ✅ | ✅ 5 | ✅ | ✅ | -| `loadInclude`2 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| ~~`loadInclude`~~2 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | [`load`](https://rollupjs.org/plugin-development/#load) | ✅ | ✅ | ✅ | ✅ 3 | ✅ | ✅ | ✅ | -| `transformInclude`2 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| ~~`transformInclude`~~2 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | [`transform`](https://rollupjs.org/plugin-development/#transform) | ✅ | ✅ | ✅ | ✅ 3 | ✅ | ✅ | ✅ | | [`watchChange`](https://rollupjs.org/plugin-development/#watchchange) | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | | [`buildEnd`](https://rollupjs.org/plugin-development/#buildend) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | @@ -209,11 +209,14 @@ export default defineConfig({ ::: details Notice 1. Rollup and esbuild do not support using `enforce` to control the order of plugins. Users need to maintain the order manually. -2. webpack's id filter is outside of loader logic; an additional hook is needed for better perf on webpack. In Rollup and Vite, this hook has been polyfilled to match the behaviors. See for the following usage examples. +2. Webpack's id filter is outside of loader logic; an additional hook is needed for better performance on Webpack and Rolldown. + However, it is now deprecated. Please use `transform/load/resolveId.filter` instead. + In Rollup, this hook has been polyfilled to match the behaviors. See the following usage examples for reference. 3. Although esbuild can handle both JavaScript and CSS and many other file formats, you can only return JavaScript in `load` and `transform` results. 4. Currently, `writeBundle` is only serves as a hook for the timing. It doesn't pass any arguments. 5. Rspack supports `resolveId` with a minimum required version of v1.0.0-alpha.1. - ::: + +::: ### Usage @@ -227,14 +230,14 @@ export interface Options { export const unpluginFactory: UnpluginFactory = options => ({ name: 'unplugin-starter', - // webpack's id filter is outside of loader logic, - // an additional hook is needed for better perf on webpack - transformInclude(id) { - return id.endsWith('main.ts') - }, - // just like rollup transform - transform(code) { - return code.replace(/