From 41bde3dfa0a7489e59ed5fa4042c6b2e38cc1ff5 Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Fri, 10 Feb 2023 15:12:20 +0800 Subject: [PATCH] =?UTF-8?q?fix(mp):=20=E9=A1=B5=E9=9D=A2=E4=BD=9C=E4=B8=BA?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E4=BD=BF=E7=94=A8=E6=97=B6=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?title=E9=85=8D=E7=BD=AE=E6=97=A0=E6=95=88=20(question/162745)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/uni-mp-vite/src/plugins/usingComponents.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/uni-mp-vite/src/plugins/usingComponents.ts b/packages/uni-mp-vite/src/plugins/usingComponents.ts index 7e13ae3a5b..fafd591531 100644 --- a/packages/uni-mp-vite/src/plugins/usingComponents.ts +++ b/packages/uni-mp-vite/src/plugins/usingComponents.ts @@ -140,7 +140,8 @@ export function uniUsingComponentsPlugin( export function dynamicImport(name: string, value: string) { // 开发者可能将页面作为组件来引用 - if (isMiniProgramPageFile(value)) { + const pagePath = value.replace(process.env.UNI_INPUT_DIR + '/', '') + if (isMiniProgramPageFile(pagePath)) { return `const ${name} = ()=>import('${virtualPagePath(value)}')` } return `const ${name} = ()=>import('${virtualComponentPath(value)}')` -- GitLab