From ad4e2e98d950e8ecfd39639e6707692d93075097 Mon Sep 17 00:00:00 2001 From: pooya parsa Date: Wed, 13 Oct 2021 22:44:52 +0200 Subject: [PATCH] fix(vite): ensure id is javascript before externalizing (#983) --- packages/vite/src/dev-bundler.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/vite/src/dev-bundler.ts b/packages/vite/src/dev-bundler.ts index 6cd3db677d..b108c56215 100644 --- a/packages/vite/src/dev-bundler.ts +++ b/packages/vite/src/dev-bundler.ts @@ -29,6 +29,10 @@ function isExternal (opts: TransformOptions, id: string) { const ssrConfig = (opts.viteServer.config as any).ssr + if (!/\.[cm]?js/.test(id)) { + return false + } + if (ssrConfig.noExternal.find(ext => id.includes(ext))) { return false }