提交 7383b7cb 编写于 作者: fxy060608's avatar fxy060608

feat(quickapp-webview): add quickapp-webview-huawei,quickapp-webview-union

上级 d6e1c8ef
......@@ -89,6 +89,16 @@ module.exports = {
init () {
// compatible with vue-cli-service lint
process.env.UNI_PLATFORM = process.env.UNI_PLATFORM || 'h5'
// hack
if (
process.env.UNI_PLATFORM === 'quickapp-webview-huawei' ||
process.env.UNI_PLATFORM === 'quickapp-webview-union'
) {
process.env.UNI_SUB_PLATFORM = process.env.UNI_PLATFORM
process.env.UNI_PLATFORM = 'quickapp-webview'
}
const plugins = resolvePlugins()
const plugin = plugins.find(plugin => plugin.name === process.env.UNI_PLATFORM)
if (!plugin) {
......
......@@ -43,6 +43,16 @@ module.exports = function initPreprocess (name, platforms, userDefines = {}) {
vueContext.APP = true
}
if (name === 'quickapp-webview') {
vueContext.QUICKAPP_WEBVIEW_HUAWEI = true
vueContext.QUICKAPP_WEBVIEW_UNION = true
if (process.env.UNI_SUB_PLATFORM === 'quickapp-webview-huawei') {
vueContext.QUICKAPP_WEBVIEW_UNION = false
} else if (process.env.UNI_SUB_PLATFORM === 'quickapp-webview-union') {
vueContext.QUICKAPP_WEBVIEW_HUAWEI = false
}
}
userDefineKeys.forEach(name => {
if (userDefines[name]) {
const key = normalize(name)
......
......@@ -30,6 +30,7 @@ module.exports = {
filterTag: 'qjs'
},
validate (platformOptions, manifestJson) {
Object.assign(platformOptions, manifestJson['quickapp-webview'] || {}, platformOptions)
if (!platformOptions.package) {
console.warn('manifest.json->quickapp-webview 缺少 package 配置')
}
......
......@@ -16,7 +16,11 @@ module.exports = function (pagesJson, manifestJson) {
manifestJson.versionName && (baseJson.versionName = manifestJson.versionName)
manifestJson.versionCode && (baseJson.versionCode = manifestJson.versionCode)
Object.assign(app.content, baseJson, manifestJson['quickapp-webview'] || {})
const options = Object.assign({}, manifestJson['quickapp-webview'] || {})
if (process.env.UNI_SUB_PLATFORM) {
Object.assign(options, manifestJson[process.env.UNI_SUB_PLATFORM] || {})
}
Object.assign(app.content, baseJson, options)
if (!app.content.package) {
app.content.package = manifestJson.name
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册