From e4c0e281fbf026061b9cf4bf66cf7e9f81d8f088 Mon Sep 17 00:00:00 2001 From: qiang Date: Tue, 8 Oct 2019 16:26:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8E=9F=E7=94=9F=E6=B7=B7=E6=B7=86?= =?UTF-8?q?=E6=94=AF=E6=8C=81subNVues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/platforms/app-plus/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.js b/packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.js index 438c366866..242fdcd47a 100644 --- a/packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.js +++ b/packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.js @@ -311,7 +311,14 @@ module.exports = function (pagesJson, userManifestJson) { } else { resources[key.replace(/\.nvue$/, '.js')] = confusion.resources[key] } - if (!Object.keys(appJson.nvue.pages).find(path => path.replace(/\.html$/, '.nvue') === key)) { + if (!Object.keys(appJson.nvue.pages).find(path => { + const subNVues = appJson.nvue.pages[path].window.subNVues || [] + return path.replace(/\.html$/, '.nvue') === key || subNVues.find(({ path }) => path === key.replace(/\.nvue$/, '')) + }) && !pagesJson.pages.find(({ style = {} }) => { + style = Object.assign(style, style['app-plus']) + const subNVues = style.subNVues || [] + return subNVues.find(({ path }) => path === key.replace(/\.nvue$/, '')) + })) { throw new Error(`原生混淆页面未在项目内使用,错误的页面路径:${key}`) } } -- GitLab