diff --git a/lerna.json b/lerna.json index febf5c43c7c98b919215ca79e0bfa3b6b7eb2adb..c5c09024f47cb390488952b3d756d8f00c849ea3 100644 --- a/lerna.json +++ b/lerna.json @@ -12,5 +12,5 @@ "message": "chore(release): publish %s" } }, - "version": "2.0.0-alpha-24720191216006" + "version": "2.0.0-alpha-24720191216032" } diff --git a/packages/uni-app-plus/dist/index.js b/packages/uni-app-plus/dist/index.js index 3b1d09c21a3969aa19d7dc72c676352dd899d29f..a7b7a15734514200ff814ebefce7332053dcef1c 100644 --- a/packages/uni-app-plus/dist/index.js +++ b/packages/uni-app-plus/dist/index.js @@ -19,7 +19,7 @@ function hasOwn (obj, key) { return hasOwnProperty.call(obj, key) } -function noop () {} +function noop () { } /** * Create a cached version of a pure function. diff --git a/packages/uni-mp-alipay/dist/index.js b/packages/uni-mp-alipay/dist/index.js index cabe08b67cd854b47edb5512da0cea31630d1089..d1a96c45af3003494cd54cd8c7b6bc89c2e66fbb 100644 --- a/packages/uni-mp-alipay/dist/index.js +++ b/packages/uni-mp-alipay/dist/index.js @@ -19,7 +19,7 @@ function hasOwn (obj, key) { return hasOwnProperty.call(obj, key) } -function noop () {} +function noop () { } /** * Create a cached version of a pure function. @@ -751,6 +751,9 @@ const protocols = { // 需要做转换的 API 列表 }, showShareMenu: { name: 'showSharePanel' + }, + hideHomeButton: { + name: 'hideBackHome' } }; diff --git a/packages/uni-mp-baidu/dist/index.js b/packages/uni-mp-baidu/dist/index.js index 9809866267f3a26b44d61baa190588b6bf99d228..8d92d8c53acb2705f99578935c21c10438b7f169 100644 --- a/packages/uni-mp-baidu/dist/index.js +++ b/packages/uni-mp-baidu/dist/index.js @@ -19,7 +19,7 @@ function hasOwn (obj, key) { return hasOwnProperty.call(obj, key) } -function noop () {} +function noop () { } /** * Create a cached version of a pure function. diff --git a/packages/uni-mp-qq/dist/index.js b/packages/uni-mp-qq/dist/index.js index d926672b00da67188909f32668809b24e7ede590..259cd9f96d816adfeee5f2ded700b0b0bacfb341 100644 --- a/packages/uni-mp-qq/dist/index.js +++ b/packages/uni-mp-qq/dist/index.js @@ -19,7 +19,7 @@ function hasOwn (obj, key) { return hasOwnProperty.call(obj, key) } -function noop () {} +function noop () { } /** * Create a cached version of a pure function. diff --git a/packages/uni-mp-toutiao/dist/index.js b/packages/uni-mp-toutiao/dist/index.js index e49173489cb35193fd1474c7c5115a026a20497c..41e0b59a2707aea4831bfbe344919e0114e9effe 100644 --- a/packages/uni-mp-toutiao/dist/index.js +++ b/packages/uni-mp-toutiao/dist/index.js @@ -19,7 +19,7 @@ function hasOwn (obj, key) { return hasOwnProperty.call(obj, key) } -function noop () {} +function noop () { } /** * Create a cached version of a pure function. diff --git a/packages/uni-mp-weixin/dist/index.js b/packages/uni-mp-weixin/dist/index.js index eed3ad93f4beb1479f26954ab88d1d7f7b77f05a..6129401510b42d4df01ad432b71c1ef38ba5932a 100644 --- a/packages/uni-mp-weixin/dist/index.js +++ b/packages/uni-mp-weixin/dist/index.js @@ -19,7 +19,7 @@ function hasOwn (obj, key) { return hasOwnProperty.call(obj, key) } -function noop () {} +function noop () { } /** * Create a cached version of a pure function. diff --git a/packages/uni-template-compiler/lib/auto-components.js b/packages/uni-template-compiler/lib/auto-components.js index 0990389e62d27e719da6f4a3b3886021c9838cf5..2ba431609cf319bfe4fe559fcda2f2e8dbcb3a40 100644 --- a/packages/uni-template-compiler/lib/auto-components.js +++ b/packages/uni-template-compiler/lib/auto-components.js @@ -20,6 +20,11 @@ function formatSource (source) { if (source.indexOf('@/') === 0) { // 根目录 source = source.replace('@/', '') } else { // node_modules + if (process.env.UNI_PLATFORM === 'mp-alipay') { + if (source.indexOf('@') === 0) { + source = source.replace('@', 'npm-scope-') + } + } source = 'node-modules/' + source } return removeExt(source) diff --git a/packages/uni-template-compiler/lib/index.js b/packages/uni-template-compiler/lib/index.js index 8989523d4a689fcce790959b46f6eeabadc0bc67..bef2878f54a6d1742da0d70b3c54bc54072fc239 100644 --- a/packages/uni-template-compiler/lib/index.js +++ b/packages/uni-template-compiler/lib/index.js @@ -79,7 +79,7 @@ module.exports = { const res = compileTemplate(source, Object.assign(options, { optimize: false - })) + }), compile) options.mp.platform = platforms[options.mp.platform] diff --git a/packages/vue-cli-plugin-uni/lib/env.js b/packages/vue-cli-plugin-uni/lib/env.js index 1780f406c25fdc9fbdfe070ff77bfe76b697080c..99617975fd785f0fd7b2c5b928c5f463640f2e56 100644 --- a/packages/vue-cli-plugin-uni/lib/env.js +++ b/packages/vue-cli-plugin-uni/lib/env.js @@ -267,20 +267,6 @@ if (process.env.UNI_PLATFORM === 'h5') { moduleAlias.addAlias('vue-style-loader', '@dcloudio/vue-cli-plugin-uni/packages/h5-vue-style-loader') } -// vue cache -if ( // 非 h5 ,非 v3,非 native - process.env.UNI_PLATFORM !== 'h5' && - !process.env.UNI_USING_V3 && - !process.env.UNI_USING_NATIVE -) { - moduleAlias.addAlias('./loaders/pitcher', (fromPath, request, alias) => { - if (fromPath.indexOf('vue-loader') !== -1) { - return require.resolve('@dcloudio/vue-cli-plugin-hbuilderx/packages/vue-loader/lib/loaders/pitcher') - } - return request - }) -} - if (process.env.UNI_PLATFORM === 'mp-toutiao') { // !important 始终带有一个空格 moduleAlias.addAlias( @@ -304,6 +290,18 @@ if (runByHBuilderX) { } } } + +// 组件自动导入配置 +process.UNI_AUTO_COMPONENTS = [] +const usingAutoImportComponents = pagesJsonObj.usingAutoImportComponents +if (usingAutoImportComponents) { + Object.keys(usingAutoImportComponents).forEach(pattern => { + process.UNI_AUTO_COMPONENTS.push({ + pattern: new RegExp(pattern), + replacement: usingAutoImportComponents[pattern] + }) + }) +} if ( process.env.UNI_USING_CACHE && @@ -321,17 +319,6 @@ if ( require('@dcloudio/uni-cli-shared/lib/cache').restore() } } -// 组件自动导入配置 -process.UNI_AUTO_COMPONENTS = [] -const usingAutoImportComponents = pagesJsonObj.usingAutoImportComponents -if (usingAutoImportComponents) { - Object.keys(usingAutoImportComponents).forEach(pattern => { - process.UNI_AUTO_COMPONENTS.push({ - pattern: new RegExp(pattern), - replacement: usingAutoImportComponents[pattern] - }) - }) -} runByHBuilderX && console.log(`正在编译中...`) diff --git a/packages/webpack-uni-pages-loader/lib/platforms/mp-qq/index.js b/packages/webpack-uni-pages-loader/lib/platforms/mp-qq/index.js index 3fed086b15a092946f335da319122d48ce82af96..8ef907c6c471796ecf64127b1a8d9ccd918b1a15 100644 --- a/packages/webpack-uni-pages-loader/lib/platforms/mp-qq/index.js +++ b/packages/webpack-uni-pages-loader/lib/platforms/mp-qq/index.js @@ -5,12 +5,13 @@ module.exports = function (pagesJson, manifestJson) { } = require('../mp')(pagesJson, manifestJson, require('./project.config.json')) if (app.content && app.content.subPackages && app.content.subPackages.length === 0) { delete app.content.subPackages - } - - project.content.qqappid = project.content.appid - project.content.qqLibVersion = project.content.libVersion - delete project.content.appid - delete project.content.libVersion + } + if (project) { + project.content.qqappid = project.content.appid + project.content.qqLibVersion = project.content.libVersion + delete project.content.appid + delete project.content.libVersion + } return [app, project] }