From f652525205b68258f5b6606c31492485f3474f3a Mon Sep 17 00:00:00 2001 From: qiang Date: Thu, 23 Apr 2020 17:42:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=20template=20?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=97=B6=20H5=20?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E6=A0=B7=E5=BC=8F=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/h5/uni.config.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/h5/uni.config.js b/lib/h5/uni.config.js index 3b68dde46..6fc36603c 100644 --- a/lib/h5/uni.config.js +++ b/lib/h5/uni.config.js @@ -1,9 +1,11 @@ const fs = require('fs') const path = require('path') -function getTemplatePath(template) { +function getTemplatePath (template) { if (template) { - return path.resolve(process.env.UNI_INPUT_DIR, template) + const userTemplate = path.resolve(process.env.UNI_INPUT_DIR, template) + if (fs.existsSync(userTemplate)) + return userTemplate } return path.resolve(process.env.UNI_CLI_CONTEXT, 'public/index.html') } @@ -51,4 +53,4 @@ module.exports = { devtool: process.env.NODE_ENV === 'production' ? false : 'cheap-module-eval-source-map' } } -} +} -- GitLab