Skip to content

Commit

Permalink
chore: rename plugin.split to plugin.create
Browse files Browse the repository at this point in the history
  • Loading branch information
patak-dev committed Apr 19, 2024
1 parent ad2b0bf commit 5f6b62f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/vite/src/node/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@ export type BoundedPlugin<A = any> = BasePlugin<A>

export interface Plugin<A = any> extends BasePlugin<A> {
/**
* Split the plugin into multiple plugins based on the environment.
* Spawn the plugin into multiple plugins based on the environment.
* This hook is called when the config has already been resolved, allowing to
* create per environment plugin pipelines or easily inject plugins for a
* only specific environments.
*/
split?: (environment: PluginEnvironment) => BoundedPluginOption
create?: (environment: PluginEnvironment) => BoundedPluginOption
/**
* Enforce plugin invocation tier similar to webpack loaders. Hooks ordering
* is still subject to the `order` property in the hook object.
Expand Down Expand Up @@ -319,8 +319,8 @@ export async function resolveBoundedPlugins(
): Promise<BoundedPlugin[]> {
const resolvedPlugins: BoundedPlugin[] = []
for (const plugin of environment.config.plugins) {
if (plugin.split) {
const boundedPlugin = await plugin.split(environment)
if (plugin.create) {
const boundedPlugin = await plugin.create(environment)
if (boundedPlugin) {
const flatPlugins = await asyncFlattenBoundedPlugin(
environment,
Expand Down

0 comments on commit 5f6b62f

Please sign in to comment.