Skip to content

Commit

Permalink
fix: make array acornInjectPlugins work (fixes #8410) (#8415)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red authored May 31, 2022
1 parent f2c869d commit 08d594b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/vite/src/node/server/pluginContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import colors from 'picocolors'
import type * as postcss from 'postcss'
import type { Plugin } from '../plugin'
import {
arraify,
cleanUrl,
combineSourcemaps,
createDebugger,
Expand Down Expand Up @@ -496,7 +497,9 @@ export async function createPluginContainer(
(await plugin.options.call(minimalContext, options)) || options
}
if (options.acornInjectPlugins) {
parser = acorn.Parser.extend(options.acornInjectPlugins as any)
parser = acorn.Parser.extend(
...(arraify(options.acornInjectPlugins) as any)
)
}
return {
acorn,
Expand Down

0 comments on commit 08d594b

Please sign in to comment.