From dd213b5454c8dd448e0767edd42e2a50bfe933a7 Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Mon, 16 Oct 2023 17:04:54 +0800 Subject: [PATCH] feat: add mdx as known js source (#14560) Co-authored-by: Mark Dalgleish --- packages/vite/src/node/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/vite/src/node/utils.ts b/packages/vite/src/node/utils.ts index 6dd182625e5e1e..dee4a5e82e99a2 100644 --- a/packages/vite/src/node/utils.ts +++ b/packages/vite/src/node/utils.ts @@ -293,7 +293,8 @@ export const isDataUrl = (url: string): boolean => dataUrlRE.test(url) export const virtualModuleRE = /^virtual-module:.*/ export const virtualModulePrefix = 'virtual-module:' -const knownJsSrcRE = /\.(?:[jt]sx?|m[jt]s|vue|marko|svelte|astro|imba)(?:$|\?)/ +const knownJsSrcRE = + /\.(?:[jt]sx?|m[jt]s|vue|marko|svelte|astro|imba|mdx)(?:$|\?)/ export const isJSRequest = (url: string): boolean => { url = cleanUrl(url) if (knownJsSrcRE.test(url)) {