diff --git a/packages/vite/src/node/plugins/css.ts b/packages/vite/src/node/plugins/css.ts index f334109735db04..73ac9df6938522 100644 --- a/packages/vite/src/node/plugins/css.ts +++ b/packages/vite/src/node/plugins/css.ts @@ -79,7 +79,7 @@ const cssLangs = `\\.(css|less|sass|scss|styl|stylus|postcss)($|\\?)` const cssLangRE = new RegExp(cssLangs) const cssModuleRE = new RegExp(`\\.module${cssLangs}`) const directRequestRE = /(\?|&)direct\b/ -const commjsProxyRE = /\?commonjs-proxy/ +const commonjsProxyRE = /\?commonjs-proxy/ export const isCSSRequest = (request: string) => cssLangRE.test(request) && !directRequestRE.test(request) @@ -120,7 +120,7 @@ export function cssPlugin(config: ResolvedConfig): Plugin { }, async transform(raw, id) { - if (!cssLangRE.test(id) || commjsProxyRE.test(id)) { + if (!cssLangRE.test(id) || commonjsProxyRE.test(id)) { return } @@ -217,7 +217,7 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin { name: 'vite:css-post', transform(css, id, ssr) { - if (!cssLangRE.test(id) || commjsProxyRE.test(id)) { + if (!cssLangRE.test(id) || commonjsProxyRE.test(id)) { return } @@ -269,7 +269,7 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin { if ( !isCSSRequest(id) || cssModuleRE.test(id) || - commjsProxyRE.test(id) + commonjsProxyRE.test(id) ) { isPureCssChunk = false } diff --git a/packages/vite/src/node/plugins/resolve.ts b/packages/vite/src/node/plugins/resolve.ts index 28c41dca753d97..804cb27a23f6fe 100644 --- a/packages/vite/src/node/plugins/resolve.ts +++ b/packages/vite/src/node/plugins/resolve.ts @@ -353,7 +353,7 @@ export function tryNodeResolve( ) { return { id: resolved } } - // if we reach here, it's a valid dep import that hasn't been optimzied. + // if we reach here, it's a valid dep import that hasn't been optimized. const isJsType = OPTIMIZABLE_ENTRY_RE.test(resolved) const exclude = server.config.optimizeDeps?.exclude if (