diff --git a/docs/guide/api-plugin.md b/docs/guide/api-plugin.md index 4d8066ff4dddb3..7f77b7b0464506 100644 --- a/docs/guide/api-plugin.md +++ b/docs/guide/api-plugin.md @@ -480,6 +480,8 @@ A Vite plugin can additionally specify an `enforce` property (similar to webpack - User plugins with `enforce: 'post'` - Vite post build plugins (minify, manifest, reporting) +Note that this is separate from hooks ordering, those are still separately subject to their `order` attribute [as usual for Rollup hooks](https://rollupjs.org/plugin-development/#build-hooks). + ## Conditional Application By default plugins are invoked for both serve and build. In cases where a plugin needs to be conditionally applied only during serve or build, use the `apply` property to only invoke them during `'build'` or `'serve'`: diff --git a/packages/vite/src/node/plugin.ts b/packages/vite/src/node/plugin.ts index 63b7598908c984..bf6eb069067bdc 100644 --- a/packages/vite/src/node/plugin.ts +++ b/packages/vite/src/node/plugin.ts @@ -39,7 +39,8 @@ import type { PreviewServerHook } from './preview' */ export interface Plugin extends RollupPlugin { /** - * Enforce plugin invocation tier similar to webpack loaders. + * Enforce plugin invocation tier similar to webpack loaders. Hooks ordering + * is still subject to the `order` property in the hook object. * * Plugin invocation order: * - alias resolution