From cb86e93e9a00a94f9defc25e070356c645e5a4f2 Mon Sep 17 00:00:00 2001 From: qiang Date: Fri, 27 Dec 2019 17:55:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=94=AF=E6=8C=81=E9=85=8D=E7=BD=AE=20n?= =?UTF-8?q?vue=20=E9=A6=96=E9=A1=B5=E5=90=AF=E5=8A=A8=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/webpack-uni-pages-loader/lib/index-new.js | 8 +++++++- .../lib/platforms/app-plus/index.v3.js | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/webpack-uni-pages-loader/lib/index-new.js b/packages/webpack-uni-pages-loader/lib/index-new.js index 6178d39037..dee90251e0 100644 --- a/packages/webpack-uni-pages-loader/lib/index-new.js +++ b/packages/webpack-uni-pages-loader/lib/index-new.js @@ -86,6 +86,12 @@ module.exports = function (content) { let appConfigContent = '' jsonFiles.forEach(jsonFile => { if (jsonFile) { + if (!isAppView && jsonFile.name === 'manifest.json') { + const content = JSON.parse(jsonFile.content) + if (!content.launch_path && content.plus['uni-app'].nvueLaunchMode === 'fast') { + console.log('Nvue 首页启动模式: fast 详见: https://ask.dcloud.net.cn/article/36749') + } + } if (jsonFile.name === 'define-pages.js') { appConfigContent = jsonFile.content } else { @@ -122,4 +128,4 @@ module.exports = function (content) { } return '' -} +} diff --git a/packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.v3.js b/packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.v3.js index 65b554e846..057e4846a3 100644 --- a/packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.v3.js +++ b/packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.v3.js @@ -92,8 +92,12 @@ module.exports = function (appJson, manifestJson, { manifestJson.plus.launch_path = '__uniappview.html' // 首页地址固定 } + // nvue 首页启动模式 + manifestJson.plus['uni-app'].nvueLaunchMode = manifestJson.plus.nvueLaunchMode === 'fast' ? 'fast' : 'normal' + delete manifestJson.plus.nvueLaunchMode + manifest.name = 'manifest.json' manifest.content = JSON.stringify(manifest.content) delete appJson.nvue return [manifest, definePages(appJson), appConfigService(appJson)] -} +} -- GitLab