From cebe2e976f19c6dc74909624cfe4ec9f7dd634bd Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 24 Jun 2020 11:14:19 -0400 Subject: [PATCH] fix: fix env replacement for vite internal modules fix #451 --- src/node/build/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/build/index.ts b/src/node/build/index.ts index 03b2d80f3ca6b6..d8d41710fc2af1 100644 --- a/src/node/build/index.ts +++ b/src/node/build/index.ts @@ -254,7 +254,7 @@ export async function build(options: BuildConfig): Promise { // - which makes it impossible to exclude Vue templates from it since // Vue templates are compiled into js and included in chunks. createReplacePlugin( - (id) => /\.(j|t)sx?$/.test(id), + (id) => /\.(j|t)sx?$/.test(id) || id.startsWith(`/vite/`), { ...userEnvReplacements, 'import.meta.env.BASE_URL': JSON.stringify(publicBasePath),