From 8cb490cf50240b98314826814bb49abaa779d50e Mon Sep 17 00:00:00 2001 From: zzcr <894103554@qq.com> Date: Thu, 18 May 2023 07:13:09 -0700 Subject: [PATCH] =?UTF-8?q?fix(build)=20=E6=8C=89=E9=9C=80=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E6=8F=92=E4=BB=B6=E6=94=AF=E6=8C=81=E5=B1=8F=E8=94=BD?= =?UTF-8?q?mobile-first=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internals/vue-vite-import/src/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internals/vue-vite-import/src/index.ts b/internals/vue-vite-import/src/index.ts index ae789839d..2695cd827 100644 --- a/internals/vue-vite-import/src/index.ts +++ b/internals/vue-vite-import/src/index.ts @@ -41,7 +41,6 @@ export default function vitePluginBabelImport( return { name: '@opentiny/vue-vite-import', transform(code, id) { - const matchValue = mode === 'pc' ? './mobile' : './pc' const isCheckMode = mode && /@opentiny\/vue-.+?\/lib\/index.js$/.test(id) // 不处理node_modules内的依赖 if (/\.(?:[jt]sx?|vue)$/.test(id) && !/(node_modules)/.test(id)) { @@ -53,7 +52,7 @@ export default function vitePluginBabelImport( map: null } } else if (isCheckMode) { - const newCode = code.replace(matchValue, `./${mode}`) + const newCode = code.replace(/("|').\/(mobile|pc|mobile-first)[.js]*("|')/g, `"./${mode}"`) return { code: newCode, map: null