Skip to content

Commit

Permalink
feat: sharedDuringBuild for bounded plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
patak-dev committed May 2, 2024
1 parent 2e6abb3 commit d213865
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions packages/vite/src/node/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1533,9 +1533,6 @@ export async function createBuilder(
let validMixedPlugins = true
for (let i = 0; i < environmentPlugins.length; i++) {
const environmentPlugin = environmentPlugins[i]
if (typeof environmentPlugin === 'function') {
continue
}
const sharedPlugin = config.rawPlugins[i]
if (
config.builder.sharedPlugins ||
Expand Down
7 changes: 4 additions & 3 deletions packages/vite/src/node/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,10 @@ export type PluginWithRequiredHook<K extends keyof Plugin> = Plugin & {
[P in K]: NonNullable<Plugin[P]>
}

export type BoundedPluginConstructor = (
Environment: PluginEnvironment,
) => BoundedPluginOption
export type BoundedPluginConstructor = {
(environment: PluginEnvironment): BoundedPluginOption
sharedDuringBuild?: boolean
}

export type MaybeBoundedPlugin = BoundedPlugin | false | null | undefined

Expand Down

0 comments on commit d213865

Please sign in to comment.