提交 f6525252 编写于 作者: Q qiang

fix: 解决 template 文件不存在时 H5 基础样式错误的问题

上级 3eb5e84d
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'
}
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册