From 08d594b823d2c82b7eb5301e5564a1d6aad79d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0=20/=20green?= Date: Wed, 1 Jun 2022 04:52:01 +0900 Subject: [PATCH] fix: make array `acornInjectPlugins` work (fixes #8410) (#8415) --- packages/vite/src/node/server/pluginContainer.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/vite/src/node/server/pluginContainer.ts b/packages/vite/src/node/server/pluginContainer.ts index 1b7e2e421960ad..ec051205eee379 100644 --- a/packages/vite/src/node/server/pluginContainer.ts +++ b/packages/vite/src/node/server/pluginContainer.ts @@ -58,6 +58,7 @@ import colors from 'picocolors' import type * as postcss from 'postcss' import type { Plugin } from '../plugin' import { + arraify, cleanUrl, combineSourcemaps, createDebugger, @@ -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,