From 1b7ff3e3938f944b959271a63af0e0ded98862c7 Mon Sep 17 00:00:00 2001 From: JayFate <48240828+JayFate@users.noreply.github.com> Date: Tue, 4 Jul 2023 14:45:59 +0800 Subject: [PATCH] refactor: simplify webpack config (#40) * refactor: simplify webpack config Signed-off-by: JayFate <37610029@qq.com> * refactor: rm dsl-xvm/src/loaders/module-loader.js Signed-off-by: JayFate <37610029@qq.com> --------- Signed-off-by: JayFate <37610029@qq.com> --- __tests__/examples/sample.test.js | 4 + .../hap-dsl-xvm/src/loaders/module-loader.js | 28 -- .../src/plugins/handler-plugin.js | 4 +- .../hap-packager/src/plugins/zip-plugin.js | 10 +- packages/hap-packager/src/webpack.post.js | 9 +- packages/hap-shared-utils/src/config.js | 4 +- .../__snapshots__/splitChunks.test.js.snap | 32 +- .../hap-toolkit/src/gen-webpack-conf/index.js | 289 +++++++++--------- 8 files changed, 175 insertions(+), 205 deletions(-) delete mode 100644 packages/hap-dsl-xvm/src/loaders/module-loader.js diff --git a/__tests__/examples/sample.test.js b/__tests__/examples/sample.test.js index e0d5375a..f86c4afc 100644 --- a/__tests__/examples/sample.test.js +++ b/__tests__/examples/sample.test.js @@ -8,12 +8,16 @@ const { Writable } = require('stream') const fetch = require('node-fetch') const fkill = require('fkill') const stripAnsi = require('strip-ansi') +const fs = require('fs-extra') const { run, lsfiles, readZip, wipeDynamic } = require('hap-dev-utils') const { compile } = require('../../packages/hap-toolkit/lib') const cwd = path.resolve(__dirname, '../../examples/sample') describe('hap-toolkit', () => { + const distDir = path.resolve(cwd, 'dist') + fs.removeSync(distDir) + it( 'hap-build: 默认流式打包,包内存在META-INF文件', async () => { diff --git a/packages/hap-dsl-xvm/src/loaders/module-loader.js b/packages/hap-dsl-xvm/src/loaders/module-loader.js deleted file mode 100644 index 72dda0e2..00000000 --- a/packages/hap-dsl-xvm/src/loaders/module-loader.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2021-present, the hapjs-platform Project Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { searchModuleImport } from '@hap-toolkit/packager' -import { scripter } from '@hap-toolkit/compiler' -import { logWarn } from '@hap-toolkit/shared-utils' - -/** - * 处理模块的引用 - * @param {string} parsed - 前一级 loader 处理后的代码 - * @param {object} sourceMap - 前一级 loader 处理后的 sourceMap - */ -export default function moduleLoader(parsed, sourceMap) { - // 更新替换 - const fileRsut = searchModuleImport(parsed) - // 内容替换 - parsed = fileRsut.fileCont - // 打印日志 - logWarn(this, fileRsut.logFeatureList) - // 引入替换 - parsed = scripter.replaceModuleImport(parsed) - - this.callback(null, parsed, sourceMap) - /*eslint-disable*/ - return -} diff --git a/packages/hap-packager/src/plugins/handler-plugin.js b/packages/hap-packager/src/plugins/handler-plugin.js index d02ea89b..c586ebf1 100644 --- a/packages/hap-packager/src/plugins/handler-plugin.js +++ b/packages/hap-packager/src/plugins/handler-plugin.js @@ -4,7 +4,7 @@ */ import Compilation from 'webpack/lib/Compilation' -import { compileOptionsMeta, compileOptionsObject } from '@hap-toolkit/shared-utils' +import { globalConfig } from '@hap-toolkit/shared-utils' import { getEntryFiles } from '../common/info' let ConcatSource @@ -49,7 +49,7 @@ function wrapCode(fileName, compilation, enableE2e, entryFiles) { } if (entryFiles.indexOf(fileName) === -1) { - if (compileOptionsObject.splitChunksMode === compileOptionsMeta.splitChunksModeEnum.SMART) { + if (globalConfig.isSmartMode) { // 抽取的JS chunk的处理,不加createPageHandler return new ConcatSource(compilation.assets[fileName]) } diff --git a/packages/hap-packager/src/plugins/zip-plugin.js b/packages/hap-packager/src/plugins/zip-plugin.js index 3b7d7d6f..60b5b95c 100644 --- a/packages/hap-packager/src/plugins/zip-plugin.js +++ b/packages/hap-packager/src/plugins/zip-plugin.js @@ -5,13 +5,7 @@ import fs from 'fs-extra' import path from 'path' -import { - colorconsole, - readJson, - globalConfig, - compileOptionsMeta, - compileOptionsObject -} from '@hap-toolkit/shared-utils' +import { colorconsole, readJson, globalConfig, compileOptionsMeta } from '@hap-toolkit/shared-utils' import { sortFilesBy, lsdirdeep, genPriorities } from '../common/utils' import { getSkeletonConfig } from '../common/info' import { DIGEST_ZIP_PATH } from '../common/constant' @@ -322,7 +316,7 @@ ZipPlugin.prototype.apply = function (compiler) { } // 抽取公共JS:app-chunks.json放在app.js之前,page-chunks.json放在app.js之后,便于流式加载 - if (compileOptionsObject.splitChunksMode === compileOptionsMeta.splitChunksModeEnum.SMART) { + if (globalConfig.isSmartMode) { const appIndex = options.priorities.findIndex((item) => { return item === 'app.js' }) diff --git a/packages/hap-packager/src/webpack.post.js b/packages/hap-packager/src/webpack.post.js index e97db6fd..0226c478 100644 --- a/packages/hap-packager/src/webpack.post.js +++ b/packages/hap-packager/src/webpack.post.js @@ -5,12 +5,7 @@ import path from 'path' import { sync as resolveSync } from 'resolve' -import { - globalConfig, - readJson, - compileOptionsMeta, - compileOptionsObject -} from '@hap-toolkit/shared-utils' +import { globalConfig, readJson, compileOptionsObject } from '@hap-toolkit/shared-utils' import { CopyDslPlugin, @@ -116,7 +111,7 @@ function postHook(webpackConf, defaultsOptions, quickappConfig = {}) { } // 抽取公共js(仅smart模式开启) - if (compileOptionsObject.splitChunksMode === compileOptionsMeta.splitChunksModeEnum.SMART) { + if (globalConfig.isSmartMode) { webpackConf.plugins.push( new SplitChunksAdaptPlugin({ subpackages, diff --git a/packages/hap-shared-utils/src/config.js b/packages/hap-shared-utils/src/config.js index 4c381559..a418d0b8 100644 --- a/packages/hap-shared-utils/src/config.js +++ b/packages/hap-shared-utils/src/config.js @@ -18,5 +18,7 @@ export default { outputPath: './build', // 输出目录, dataCoverage: './.nyc_output', // 项目运行的代码覆盖率数据 command: 'build', - server: { port: 8000 } + server: { port: 8000 }, + // 代码风格规则 + isSmartMode: false } diff --git a/packages/hap-toolkit/__tests__/__snapshots__/splitChunks.test.js.snap b/packages/hap-toolkit/__tests__/__snapshots__/splitChunks.test.js.snap index ebfd04ce..9741924b 100644 --- a/packages/hap-toolkit/__tests__/__snapshots__/splitChunks.test.js.snap +++ b/packages/hap-toolkit/__tests__/__snapshots__/splitChunks.test.js.snap @@ -84,7 +84,7 @@ $app_define$('@app-component/index', [], function($app_require$, $app_exports$, $app_module$.exports.template = __webpack_require__(/*! !../../../../../hap-dsl-xvm/lib/loaders/template-loader.js!../../../../../hap-dsl-xvm/lib/loaders/fragment-loader.js?index=0&type=template!./index.ux?uxType=page&importNames[]=compb */ \\"../../../hap-dsl-xvm/lib/loaders/template-loader.js!../../../hap-dsl-xvm/lib/loaders/fragment-loader.js?index=0&type=template!./src/About/index.ux?uxType=page&importNames[]=compb\\") }) -$app_bootstrap$('@app-component/index',{ packagerVersion: \\"\\" }) +$app_bootstrap$('@app-component/index',{ packagerVersion: undefined }) /***/ }) @@ -314,7 +314,7 @@ $app_define$('@app-component/index', [], function($app_require$, $app_exports$, $app_module$.exports.template = __webpack_require__(/*! !../../../../../hap-dsl-xvm/lib/loaders/template-loader.js!../../../../../hap-dsl-xvm/lib/loaders/fragment-loader.js?index=0&type=template!./index.ux?uxType=page&importNames[]=compa,importNames[]=compb */ \\"../../../hap-dsl-xvm/lib/loaders/template-loader.js!../../../hap-dsl-xvm/lib/loaders/fragment-loader.js?index=0&type=template!./src/Demo/index.ux?uxType=page&importNames[]=compa,importNames[]=compb\\") }) -$app_bootstrap$('@app-component/index',{ packagerVersion: \\"\\" }) +$app_bootstrap$('@app-component/index',{ packagerVersion: undefined }) /***/ }) @@ -546,7 +546,7 @@ $app_define$('@app-component/index', [], function($app_require$, $app_exports$, $app_module$.exports.template = __webpack_require__(/*! !../../../../../hap-dsl-xvm/lib/loaders/template-loader.js!../../../../../hap-dsl-xvm/lib/loaders/fragment-loader.js?index=0&type=template!./index.ux?uxType=page&importNames[]=compa */ \\"../../../hap-dsl-xvm/lib/loaders/template-loader.js!../../../hap-dsl-xvm/lib/loaders/fragment-loader.js?index=0&type=template!./src/DemoDetail/index.ux?uxType=page&importNames[]=compa\\") }) -$app_bootstrap$('@app-component/index',{ packagerVersion: \\"\\" }) +$app_bootstrap$('@app-component/index',{ packagerVersion: undefined }) /***/ }) @@ -723,7 +723,7 @@ $app_define$('@app-application/app', [], function ($app_require$, $app_exports$, $app_module$.exports.style = { list: [ $app_style$ ] } }) -$app_bootstrap$('@app-application/app', { packagerVersion: \\"\\" }) +$app_bootstrap$('@app-application/app', { packagerVersion: undefined }) /***/ }), @@ -893,26 +893,26 @@ module.exports = JSON.parse('{\\"package\\":\\"com.application.demo\\",\\"name\\ })();" `; -exports[`split chunks on a project release results include split chunks for [SMART]: /build/About/index.js 1`] = `"!function(){var e=function(){return(()=>{var e=Object.getPrototypeOf(global)||global;e.chunkFileMap=e.chunkFileMap||{999:\\"Common/moduleA.js\\",999:\\"Common/compB.js\\",999:\\"Common/compA.js\\",999:\\"Common/moduleB.js\\"};var t,o={999:(e,t,o)=>{e.exports=function(e,t,r){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,o(999),t.default={};const a=t.default||e.exports,n=[\\"public\\",\\"protected\\",\\"private\\"];if(a.data&&n.some((function(e){return a[e]})))throw new Error('页面VM对象中的属性data不可与\\"'+n.join(\\",\\")+'\\"同时存在,请使用private替换data名称');a.data||(a.data={},a._descriptor={},n.forEach((function(e){const t=typeof a[e];if(\\"object\\"===t){a.data=Object.assign(a.data,a[e]);for(const t in a[e])a._descriptor[t]={access:e}}else\\"function\\"===t&&console.warn(\\"页面VM对象中的属性\\"+e+\\"的值不能是函数,请使用对象\\")})))}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:(e,t,o,r,a,n,p)=>{o(999);var i=o(999);r(\\"@app-component/index\\",[],(function(e,t,r){i(r,t,e),t.__esModule&&t.default&&(r.exports=t.default),r.exports.template=o(999)})),a(\\"@app-component/index\\",{packagerVersion:\\"\\"})}},r={};function a(e){var t=r[e];if(void 0!==t)return t.exports;var n=r[e]={exports:{}};return o[e].call(n.exports,n,n.exports,a,$app_define$,$app_bootstrap$,$app_require$,$app_define_wrap$),n.exports}a.m=o,t=[],a.O=(o,r,n,p)=>{if(!r){var i=1/0;for(l=0;l=p)&&Object.keys(a.O).every((e=>a.O[e](r[c])))?r.splice(c--,1):(s=!1,$app_evaluate$(\`\${e.chunkFileMap[r[c]]}\`),p0&&t[l-1][2]>p;l--)t[l]=t[l-1];t[l]=[r,n,p]},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var t={999:0};a.O.j=e=>0===t[e];var o=(e,o)=>{var r,n,[p,i,s]=o,c=0;if(p.some((e=>0!==t[e]))){for(r in i)a.o(i,r)&&(a.m[r]=i[r]);if(s)var u=s(a)}for(e&&e(o);ca(999)));n=a.O(n)})()};if(\\"undefined\\"==typeof window)return e();window.createPageHandler=e}();"`; +exports[`split chunks on a project release results include split chunks for [SMART]: /build/About/index.js 1`] = `"!function(){var e=function(){return(()=>{var e=Object.getPrototypeOf(global)||global;e.chunkFileMap=e.chunkFileMap||{999:\\"Common/moduleA.js\\",999:\\"Common/compB.js\\",999:\\"Common/compA.js\\",999:\\"Common/moduleB.js\\"};var o,t={999:(e,o,t)=>{e.exports=function(e,o,r){\\"use strict\\";Object.defineProperty(o,\\"__esModule\\",{value:!0}),o.default=void 0,t(999),o.default={};const a=o.default||e.exports,n=[\\"public\\",\\"protected\\",\\"private\\"];if(a.data&&n.some((function(e){return a[e]})))throw new Error('页面VM对象中的属性data不可与\\"'+n.join(\\",\\")+'\\"同时存在,请使用private替换data名称');a.data||(a.data={},a._descriptor={},n.forEach((function(e){const o=typeof a[e];if(\\"object\\"===o){a.data=Object.assign(a.data,a[e]);for(const o in a[e])a._descriptor[o]={access:e}}else\\"function\\"===o&&console.warn(\\"页面VM对象中的属性\\"+e+\\"的值不能是函数,请使用对象\\")})))}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:(e,o,t,r,a,n,p)=>{t(999);var i=t(999);r(\\"@app-component/index\\",[],(function(e,o,r){i(r,o,e),o.__esModule&&o.default&&(r.exports=o.default),r.exports.template=t(999)})),a(\\"@app-component/index\\",{packagerVersion:void 0})}},r={};function a(e){var o=r[e];if(void 0!==o)return o.exports;var n=r[e]={exports:{}};return t[e].call(n.exports,n,n.exports,a,$app_define$,$app_bootstrap$,$app_require$,$app_define_wrap$),n.exports}a.m=t,o=[],a.O=(t,r,n,p)=>{if(!r){var i=1/0;for(l=0;l=p)&&Object.keys(a.O).every((e=>a.O[e](r[c])))?r.splice(c--,1):(s=!1,$app_evaluate$(\`\${e.chunkFileMap[r[c]]}\`),p0&&o[l-1][2]>p;l--)o[l]=o[l-1];o[l]=[r,n,p]},a.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var o={999:0};a.O.j=e=>0===o[e];var t=(e,t)=>{var r,n,[p,i,s]=t,c=0;if(p.some((e=>0!==o[e]))){for(r in i)a.o(i,r)&&(a.m[r]=i[r]);if(s)var u=s(a)}for(e&&e(t);ca(999)));n=a.O(n)})()};if(\\"undefined\\"==typeof window)return e();window.createPageHandler=e}();"`; -exports[`split chunks on a project release results include split chunks for [SMART]: /build/Demo/index.js 1`] = `"!function(){var e=function(){return(()=>{var e=Object.getPrototypeOf(global)||global;e.chunkFileMap=e.chunkFileMap||{999:\\"Common/moduleA.js\\",999:\\"Common/compB.js\\",999:\\"Common/compA.js\\",999:\\"Common/moduleB.js\\"};var t,o={999:(e,t,o)=>{e.exports=function(e,t,r){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,o(999),o(999),t.default={};const a=t.default||e.exports,n=[\\"public\\",\\"protected\\",\\"private\\"];if(a.data&&n.some((function(e){return a[e]})))throw new Error('页面VM对象中的属性data不可与\\"'+n.join(\\",\\")+'\\"同时存在,请使用private替换data名称');a.data||(a.data={},a._descriptor={},n.forEach((function(e){const t=typeof a[e];if(\\"object\\"===t){a.data=Object.assign(a.data,a[e]);for(const t in a[e])a._descriptor[t]={access:e}}else\\"function\\"===t&&console.warn(\\"页面VM对象中的属性\\"+e+\\"的值不能是函数,请使用对象\\")})))}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:(e,t,o,r,a,n,p)=>{o(999),o(999);var i=o(999);r(\\"@app-component/index\\",[],(function(e,t,r){i(r,t,e),t.__esModule&&t.default&&(r.exports=t.default),r.exports.template=o(999)})),a(\\"@app-component/index\\",{packagerVersion:\\"\\"})}},r={};function a(e){var t=r[e];if(void 0!==t)return t.exports;var n=r[e]={exports:{}};return o[e].call(n.exports,n,n.exports,a,$app_define$,$app_bootstrap$,$app_require$,$app_define_wrap$),n.exports}a.m=o,t=[],a.O=(o,r,n,p)=>{if(!r){var i=1/0;for(l=0;l=p)&&Object.keys(a.O).every((e=>a.O[e](r[c])))?r.splice(c--,1):(s=!1,$app_evaluate$(\`\${e.chunkFileMap[r[c]]}\`),p0&&t[l-1][2]>p;l--)t[l]=t[l-1];t[l]=[r,n,p]},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var t={999:0};a.O.j=e=>0===t[e];var o=(e,o)=>{var r,n,[p,i,s]=o,c=0;if(p.some((e=>0!==t[e]))){for(r in i)a.o(i,r)&&(a.m[r]=i[r]);if(s)var u=s(a)}for(e&&e(o);ca(999)));n=a.O(n)})()};if(\\"undefined\\"==typeof window)return e();window.createPageHandler=e}();"`; +exports[`split chunks on a project release results include split chunks for [SMART]: /build/Demo/index.js 1`] = `"!function(){var e=function(){return(()=>{var e=Object.getPrototypeOf(global)||global;e.chunkFileMap=e.chunkFileMap||{999:\\"Common/moduleA.js\\",999:\\"Common/compB.js\\",999:\\"Common/compA.js\\",999:\\"Common/moduleB.js\\"};var o,t={999:(e,o,t)=>{e.exports=function(e,o,r){\\"use strict\\";Object.defineProperty(o,\\"__esModule\\",{value:!0}),o.default=void 0,t(999),t(999),o.default={};const a=o.default||e.exports,n=[\\"public\\",\\"protected\\",\\"private\\"];if(a.data&&n.some((function(e){return a[e]})))throw new Error('页面VM对象中的属性data不可与\\"'+n.join(\\",\\")+'\\"同时存在,请使用private替换data名称');a.data||(a.data={},a._descriptor={},n.forEach((function(e){const o=typeof a[e];if(\\"object\\"===o){a.data=Object.assign(a.data,a[e]);for(const o in a[e])a._descriptor[o]={access:e}}else\\"function\\"===o&&console.warn(\\"页面VM对象中的属性\\"+e+\\"的值不能是函数,请使用对象\\")})))}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:(e,o,t,r,a,n,p)=>{t(999),t(999);var i=t(999);r(\\"@app-component/index\\",[],(function(e,o,r){i(r,o,e),o.__esModule&&o.default&&(r.exports=o.default),r.exports.template=t(999)})),a(\\"@app-component/index\\",{packagerVersion:void 0})}},r={};function a(e){var o=r[e];if(void 0!==o)return o.exports;var n=r[e]={exports:{}};return t[e].call(n.exports,n,n.exports,a,$app_define$,$app_bootstrap$,$app_require$,$app_define_wrap$),n.exports}a.m=t,o=[],a.O=(t,r,n,p)=>{if(!r){var i=1/0;for(l=0;l=p)&&Object.keys(a.O).every((e=>a.O[e](r[c])))?r.splice(c--,1):(s=!1,$app_evaluate$(\`\${e.chunkFileMap[r[c]]}\`),p0&&o[l-1][2]>p;l--)o[l]=o[l-1];o[l]=[r,n,p]},a.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var o={999:0};a.O.j=e=>0===o[e];var t=(e,t)=>{var r,n,[p,i,s]=t,c=0;if(p.some((e=>0!==o[e]))){for(r in i)a.o(i,r)&&(a.m[r]=i[r]);if(s)var u=s(a)}for(e&&e(t);ca(999)));n=a.O(n)})()};if(\\"undefined\\"==typeof window)return e();window.createPageHandler=e}();"`; -exports[`split chunks on a project release results include split chunks for [SMART]: /build/DemoDetail/index.js 1`] = `"!function(){var e=function(){return(()=>{var e=Object.getPrototypeOf(global)||global;e.chunkFileMap=e.chunkFileMap||{999:\\"Common/moduleA.js\\",999:\\"Common/compB.js\\",999:\\"Common/compA.js\\",999:\\"Common/moduleB.js\\"};var o,t={999:(e,o,t)=>{e.exports=function(e,o,r){\\"use strict\\";Object.defineProperty(o,\\"__esModule\\",{value:!0}),o.default=void 0,t(999);var a={onMenuPress(){this.$app.$def.showMenu()}};o.default=a;const n=o.default||e.exports,p=[\\"public\\",\\"protected\\",\\"private\\"];if(n.data&&p.some((function(e){return n[e]})))throw new Error('页面VM对象中的属性data不可与\\"'+p.join(\\",\\")+'\\"同时存在,请使用private替换data名称');n.data||(n.data={},n._descriptor={},p.forEach((function(e){const o=typeof n[e];if(\\"object\\"===o){n.data=Object.assign(n.data,n[e]);for(const o in n[e])n._descriptor[o]={access:e}}else\\"function\\"===o&&console.warn(\\"页面VM对象中的属性\\"+e+\\"的值不能是函数,请使用对象\\")})))}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:(e,o,t,r,a,n,p)=>{t(999);var i=t(999);r(\\"@app-component/index\\",[],(function(e,o,r){i(r,o,e),o.__esModule&&o.default&&(r.exports=o.default),r.exports.template=t(999)})),a(\\"@app-component/index\\",{packagerVersion:\\"\\"})}},r={};function a(e){var o=r[e];if(void 0!==o)return o.exports;var n=r[e]={exports:{}};return t[e].call(n.exports,n,n.exports,a,$app_define$,$app_bootstrap$,$app_require$,$app_define_wrap$),n.exports}a.m=t,o=[],a.O=(t,r,n,p)=>{if(!r){var i=1/0;for(l=0;l=p)&&Object.keys(a.O).every((e=>a.O[e](r[u])))?r.splice(u--,1):(s=!1,$app_evaluate$(\`\${e.chunkFileMap[r[u]]}\`),p0&&o[l-1][2]>p;l--)o[l]=o[l-1];o[l]=[r,n,p]},a.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var o={999:0};a.O.j=e=>0===o[e];var t=(e,t)=>{var r,n,[p,i,s]=t,u=0;if(p.some((e=>0!==o[e]))){for(r in i)a.o(i,r)&&(a.m[r]=i[r]);if(s)var c=s(a)}for(e&&e(t);ua(999)));n=a.O(n)})()};if(\\"undefined\\"==typeof window)return e();window.createPageHandler=e}();"`; +exports[`split chunks on a project release results include split chunks for [SMART]: /build/DemoDetail/index.js 1`] = `"!function(){var e=function(){return(()=>{var e=Object.getPrototypeOf(global)||global;e.chunkFileMap=e.chunkFileMap||{999:\\"Common/moduleA.js\\",999:\\"Common/compB.js\\",999:\\"Common/compA.js\\",999:\\"Common/moduleB.js\\"};var o,t={999:(e,o,t)=>{e.exports=function(e,o,r){\\"use strict\\";Object.defineProperty(o,\\"__esModule\\",{value:!0}),o.default=void 0,t(999);var a={onMenuPress(){this.$app.$def.showMenu()}};o.default=a;const n=o.default||e.exports,p=[\\"public\\",\\"protected\\",\\"private\\"];if(n.data&&p.some((function(e){return n[e]})))throw new Error('页面VM对象中的属性data不可与\\"'+p.join(\\",\\")+'\\"同时存在,请使用private替换data名称');n.data||(n.data={},n._descriptor={},p.forEach((function(e){const o=typeof n[e];if(\\"object\\"===o){n.data=Object.assign(n.data,n[e]);for(const o in n[e])n._descriptor[o]={access:e}}else\\"function\\"===o&&console.warn(\\"页面VM对象中的属性\\"+e+\\"的值不能是函数,请使用对象\\")})))}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:(e,o,t,r,a,n,p)=>{t(999);var i=t(999);r(\\"@app-component/index\\",[],(function(e,o,r){i(r,o,e),o.__esModule&&o.default&&(r.exports=o.default),r.exports.template=t(999)})),a(\\"@app-component/index\\",{packagerVersion:void 0})}},r={};function a(e){var o=r[e];if(void 0!==o)return o.exports;var n=r[e]={exports:{}};return t[e].call(n.exports,n,n.exports,a,$app_define$,$app_bootstrap$,$app_require$,$app_define_wrap$),n.exports}a.m=t,o=[],a.O=(t,r,n,p)=>{if(!r){var i=1/0;for(d=0;d=p)&&Object.keys(a.O).every((e=>a.O[e](r[u])))?r.splice(u--,1):(s=!1,$app_evaluate$(\`\${e.chunkFileMap[r[u]]}\`),p0&&o[d-1][2]>p;d--)o[d]=o[d-1];o[d]=[r,n,p]},a.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var o={999:0};a.O.j=e=>0===o[e];var t=(e,t)=>{var r,n,[p,i,s]=t,u=0;if(p.some((e=>0!==o[e]))){for(r in i)a.o(i,r)&&(a.m[r]=i[r]);if(s)var c=s(a)}for(e&&e(t);ua(999)));n=a.O(n)})()};if(\\"undefined\\"==typeof window)return e();window.createPageHandler=e}();"`; -exports[`split chunks on a project release results include split chunks for [SMART]: /build/app.js 1`] = `"!function(){var e=e||function(){},o=function(){return(()=>{var o=Object.getPrototypeOf(global)||global;o.chunkFileMap=o.chunkFileMap||{999:\\"Common/moduleA.js\\",999:\\"Common/compB.js\\",999:\\"Common/compA.js\\",999:\\"Common/moduleB.js\\"};var t,n={999:(e,o,t,n,r,a,i)=>{var p={},s=t(999);n(\\"@app-application/app\\",[],(function(e,o,n){s(n,o,e),o.__esModule&&o.default&&(n.exports=o.default),n.exports.manifest=t(999),n.exports.style={list:[p]}})),r(\\"@app-application/app\\",{packagerVersion:\\"\\"})},999:(e,o,t)=>{e.exports=function(e,o,n){\\"use strict\\";t(999)}},999:e=>{\\"use strict\\";e.exports=JSON.parse('{\\"package\\":\\"com.application.demo\\",\\"name\\":\\"lewis-demo\\",\\"versionName\\":\\"1.0.0\\",\\"versionCode\\":\\"1\\",\\"minPlatformVersion\\":1070,\\"icon\\":\\"/Common/logo.png\\",\\"features\\":[{\\"name\\":\\"system.prompt\\"},{\\"name\\":\\"system.router\\"},{\\"name\\":\\"system.shortcut\\"}],\\"permissions\\":[{\\"origin\\":\\"*\\"}],\\"config\\":{\\"logLevel\\":\\"trace\\"},\\"router\\":{\\"entry\\":\\"Demo\\",\\"pages\\":{\\"Demo\\":{\\"component\\":\\"index\\"},\\"DemoDetail\\":{\\"component\\":\\"index\\"},\\"About\\":{\\"component\\":\\"index\\"}}},\\"display\\":{\\"titleBarBackgroundColor\\":\\"#f2f2f2\\",\\"titleBarTextColor\\":\\"#414141\\",\\"menu\\":true,\\"pages\\":{\\"Demo\\":{\\"titleBarText\\":\\"示例页\\",\\"menu\\":false},\\"DemoDetail\\":{\\"titleBarText\\":\\"详情页\\"},\\"About\\":{\\"menu\\":false}}}}')}},r={};function a(o){var t=r[o];if(void 0!==t)return t.exports;var i=r[o]={exports:{}};return n[o].call(i.exports,i,i.exports,a,$app_define$,$app_bootstrap$,$app_require$,e),i.exports}a.m=n,t=[],a.O=(e,n,r,i)=>{if(!n){var p=1/0;for(u=0;u=i)&&Object.keys(a.O).every((e=>a.O[e](n[m])))?n.splice(m--,1):(s=!1,$app_evaluate$(\`\${o.chunkFileMap[n[m]]}\`),i0&&t[u-1][2]>i;u--)t[u]=t[u-1];t[u]=[n,r,i]},a.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={999:0};a.O.j=o=>0===e[o];var t=(o,t)=>{var n,r,[i,p,s]=t,m=0;if(i.some((o=>0!==e[o]))){for(n in p)a.o(p,n)&&(a.m[n]=p[n]);if(s)var l=s(a)}for(o&&o(t);ma(999)));i=a.O(i)})()};if(\\"undefined\\"==typeof window)return o();window.createAppHandler=o,global.manifest={package:\\"com.application.demo\\",name:\\"lewis-demo\\",versionName:\\"1.0.0\\",versionCode:\\"1\\",minPlatformVersion:1070,icon:\\"/Common/logo.png\\",features:[{name:\\"system.prompt\\"},{name:\\"system.router\\"},{name:\\"system.shortcut\\"}],permissions:[{origin:\\"*\\"}],config:{logLevel:\\"trace\\"},router:{entry:\\"Demo\\",pages:{Demo:{component:\\"index\\"},DemoDetail:{component:\\"index\\"},About:{component:\\"index\\"}}},display:{titleBarBackgroundColor:\\"#f2f2f2\\",titleBarTextColor:\\"#414141\\",menu:!0,pages:{Demo:{titleBarText:\\"示例页\\",menu:!1},DemoDetail:{titleBarText:\\"详情页\\"},About:{menu:!1}}}}}();"`; +exports[`split chunks on a project release results include split chunks for [SMART]: /build/app.js 1`] = `"!function(){var e=e||function(){},o=function(){return(()=>{var o=Object.getPrototypeOf(global)||global;o.chunkFileMap=o.chunkFileMap||{999:\\"Common/moduleA.js\\",999:\\"Common/compB.js\\",999:\\"Common/compA.js\\",999:\\"Common/moduleB.js\\"};var t,n={999:(e,o,t,n,r,a,i)=>{var p={},s=t(999);n(\\"@app-application/app\\",[],(function(e,o,n){s(n,o,e),o.__esModule&&o.default&&(n.exports=o.default),n.exports.manifest=t(999),n.exports.style={list:[p]}})),r(\\"@app-application/app\\",{packagerVersion:void 0})},999:(e,o,t)=>{e.exports=function(e,o,n){\\"use strict\\";t(999)}},999:e=>{\\"use strict\\";e.exports=JSON.parse('{\\"package\\":\\"com.application.demo\\",\\"name\\":\\"lewis-demo\\",\\"versionName\\":\\"1.0.0\\",\\"versionCode\\":\\"1\\",\\"minPlatformVersion\\":1070,\\"icon\\":\\"/Common/logo.png\\",\\"features\\":[{\\"name\\":\\"system.prompt\\"},{\\"name\\":\\"system.router\\"},{\\"name\\":\\"system.shortcut\\"}],\\"permissions\\":[{\\"origin\\":\\"*\\"}],\\"config\\":{\\"logLevel\\":\\"trace\\"},\\"router\\":{\\"entry\\":\\"Demo\\",\\"pages\\":{\\"Demo\\":{\\"component\\":\\"index\\"},\\"DemoDetail\\":{\\"component\\":\\"index\\"},\\"About\\":{\\"component\\":\\"index\\"}}},\\"display\\":{\\"titleBarBackgroundColor\\":\\"#f2f2f2\\",\\"titleBarTextColor\\":\\"#414141\\",\\"menu\\":true,\\"pages\\":{\\"Demo\\":{\\"titleBarText\\":\\"示例页\\",\\"menu\\":false},\\"DemoDetail\\":{\\"titleBarText\\":\\"详情页\\"},\\"About\\":{\\"menu\\":false}}}}')}},r={};function a(o){var t=r[o];if(void 0!==t)return t.exports;var i=r[o]={exports:{}};return n[o].call(i.exports,i,i.exports,a,$app_define$,$app_bootstrap$,$app_require$,e),i.exports}a.m=n,t=[],a.O=(e,n,r,i)=>{if(!n){var p=1/0;for(u=0;u=i)&&Object.keys(a.O).every((e=>a.O[e](n[m])))?n.splice(m--,1):(s=!1,$app_evaluate$(\`\${o.chunkFileMap[n[m]]}\`),i0&&t[u-1][2]>i;u--)t[u]=t[u-1];t[u]=[n,r,i]},a.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={999:0};a.O.j=o=>0===e[o];var t=(o,t)=>{var n,r,[i,p,s]=t,m=0;if(i.some((o=>0!==e[o]))){for(n in p)a.o(p,n)&&(a.m[n]=p[n]);if(s)var l=s(a)}for(o&&o(t);ma(999)));i=a.O(i)})()};if(\\"undefined\\"==typeof window)return o();window.createAppHandler=o,global.manifest={package:\\"com.application.demo\\",name:\\"lewis-demo\\",versionName:\\"1.0.0\\",versionCode:\\"1\\",minPlatformVersion:1070,icon:\\"/Common/logo.png\\",features:[{name:\\"system.prompt\\"},{name:\\"system.router\\"},{name:\\"system.shortcut\\"}],permissions:[{origin:\\"*\\"}],config:{logLevel:\\"trace\\"},router:{entry:\\"Demo\\",pages:{Demo:{component:\\"index\\"},DemoDetail:{component:\\"index\\"},About:{component:\\"index\\"}}},display:{titleBarBackgroundColor:\\"#f2f2f2\\",titleBarTextColor:\\"#414141\\",menu:!0,pages:{Demo:{titleBarText:\\"示例页\\",menu:!1},DemoDetail:{titleBarText:\\"详情页\\"},About:{menu:!1}}}}}();"`; -exports[`split chunks on a project release results not include split chunks for [REDUNDANCY]: /build/About/index.js 1`] = `"!function(){var e=function(){return(()=>{var e={999:(e,t,o)=>{e.exports=function(e,t,r){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,o(999),t.default={};const n=t.default||e.exports,a=[\\"public\\",\\"protected\\",\\"private\\"];if(n.data&&a.some((function(e){return n[e]})))throw new Error('页面VM对象中的属性data不可与\\"'+a.join(\\",\\")+'\\"同时存在,请使用private替换data名称');n.data||(n.data={},n._descriptor={},a.forEach((function(e){const t=typeof n[e];if(\\"object\\"===t){n.data=Object.assign(n.data,n[e]);for(const t in n[e])n._descriptor[t]={access:e}}else\\"function\\"===t&&console.warn(\\"页面VM对象中的属性\\"+e+\\"的值不能是函数,请使用对象\\")})))}},999:e=>{e.exports=function(e,t,o){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,t.default={}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:(e,t,o)=>{var r=o(999);$app_define$(\\"@app-component/compb\\",[],(function(e,t,n){r(n,t,e),t.__esModule&&t.default&&(n.exports=t.default),n.exports.template=o(999)}))},999:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.multiply=function(e,t){return e*t}}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,o),a.exports}(()=>{o(999);var e=o(999);$app_define$(\\"@app-component/index\\",[],(function(t,r,n){e(n,r,t),r.__esModule&&r.default&&(n.exports=r.default),n.exports.template=o(999)})),$app_bootstrap$(\\"@app-component/index\\",{packagerVersion:\\"\\"})})()})()};if(\\"undefined\\"==typeof window)return e();window.createPageHandler=e}();"`; +exports[`split chunks on a project release results not include split chunks for [REDUNDANCY]: /build/About/index.js 1`] = `"!function(){var e=function(){return(()=>{var e={999:(e,t,o)=>{e.exports=function(e,t,r){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,o(999),t.default={};const n=t.default||e.exports,a=[\\"public\\",\\"protected\\",\\"private\\"];if(n.data&&a.some((function(e){return n[e]})))throw new Error('页面VM对象中的属性data不可与\\"'+a.join(\\",\\")+'\\"同时存在,请使用private替换data名称');n.data||(n.data={},n._descriptor={},a.forEach((function(e){const t=typeof n[e];if(\\"object\\"===t){n.data=Object.assign(n.data,n[e]);for(const t in n[e])n._descriptor[t]={access:e}}else\\"function\\"===t&&console.warn(\\"页面VM对象中的属性\\"+e+\\"的值不能是函数,请使用对象\\")})))}},999:e=>{e.exports=function(e,t,o){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,t.default={}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:(e,t,o)=>{var r=o(999);$app_define$(\\"@app-component/compb\\",[],(function(e,t,n){r(n,t,e),t.__esModule&&t.default&&(n.exports=t.default),n.exports.template=o(999)}))},999:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.multiply=function(e,t){return e*t}}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,o),a.exports}(()=>{o(999);var e=o(999);$app_define$(\\"@app-component/index\\",[],(function(t,r,n){e(n,r,t),r.__esModule&&r.default&&(n.exports=r.default),n.exports.template=o(999)})),$app_bootstrap$(\\"@app-component/index\\",{packagerVersion:void 0})})()})()};if(\\"undefined\\"==typeof window)return e();window.createPageHandler=e}();"`; -exports[`split chunks on a project release results not include split chunks for [REDUNDANCY]: /build/Demo/index.js 1`] = `"!function(){var e=function(){return(()=>{var e={999:(e,t,o)=>{e.exports=function(e,t,r){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,o(999),o(999),t.default={};const n=t.default||e.exports,a=[\\"public\\",\\"protected\\",\\"private\\"];if(n.data&&a.some((function(e){return n[e]})))throw new Error('页面VM对象中的属性data不可与\\"'+a.join(\\",\\")+'\\"同时存在,请使用private替换data名称');n.data||(n.data={},n._descriptor={},a.forEach((function(e){const t=typeof n[e];if(\\"object\\"===t){n.data=Object.assign(n.data,n[e]);for(const t in n[e])n._descriptor[t]={access:e}}else\\"function\\"===t&&console.warn(\\"页面VM对象中的属性\\"+e+\\"的值不能是函数,请使用对象\\")})))}},999:e=>{e.exports=function(e,t,o){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,t.default={}}},999:e=>{e.exports=function(e,t,o){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,t.default={}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:(e,t,o)=>{var r=o(999);$app_define$(\\"@app-component/compa\\",[],(function(e,t,n){r(n,t,e),t.__esModule&&t.default&&(n.exports=t.default),n.exports.template=o(999)}))},999:(e,t,o)=>{var r=o(999);$app_define$(\\"@app-component/compb\\",[],(function(e,t,n){r(n,t,e),t.__esModule&&t.default&&(n.exports=t.default),n.exports.template=o(999)}))},999:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.add=function(e,t){return e+t}},999:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.multiply=function(e,t){return e*t}}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,o),a.exports}(()=>{o(999),o(999);var e=o(999);$app_define$(\\"@app-component/index\\",[],(function(t,r,n){e(n,r,t),r.__esModule&&r.default&&(n.exports=r.default),n.exports.template=o(999)})),$app_bootstrap$(\\"@app-component/index\\",{packagerVersion:\\"\\"})})()})()};if(\\"undefined\\"==typeof window)return e();window.createPageHandler=e}();"`; +exports[`split chunks on a project release results not include split chunks for [REDUNDANCY]: /build/Demo/index.js 1`] = `"!function(){var e=function(){return(()=>{var e={999:(e,t,o)=>{e.exports=function(e,t,r){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,o(999),o(999),t.default={};const n=t.default||e.exports,a=[\\"public\\",\\"protected\\",\\"private\\"];if(n.data&&a.some((function(e){return n[e]})))throw new Error('页面VM对象中的属性data不可与\\"'+a.join(\\",\\")+'\\"同时存在,请使用private替换data名称');n.data||(n.data={},n._descriptor={},a.forEach((function(e){const t=typeof n[e];if(\\"object\\"===t){n.data=Object.assign(n.data,n[e]);for(const t in n[e])n._descriptor[t]={access:e}}else\\"function\\"===t&&console.warn(\\"页面VM对象中的属性\\"+e+\\"的值不能是函数,请使用对象\\")})))}},999:e=>{e.exports=function(e,t,o){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,t.default={}}},999:e=>{e.exports=function(e,t,o){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,t.default={}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:(e,t,o)=>{var r=o(999);$app_define$(\\"@app-component/compa\\",[],(function(e,t,n){r(n,t,e),t.__esModule&&t.default&&(n.exports=t.default),n.exports.template=o(999)}))},999:(e,t,o)=>{var r=o(999);$app_define$(\\"@app-component/compb\\",[],(function(e,t,n){r(n,t,e),t.__esModule&&t.default&&(n.exports=t.default),n.exports.template=o(999)}))},999:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.add=function(e,t){return e+t}},999:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.multiply=function(e,t){return e*t}}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,o),a.exports}(()=>{o(999),o(999);var e=o(999);$app_define$(\\"@app-component/index\\",[],(function(t,r,n){e(n,r,t),r.__esModule&&r.default&&(n.exports=r.default),n.exports.template=o(999)})),$app_bootstrap$(\\"@app-component/index\\",{packagerVersion:void 0})})()})()};if(\\"undefined\\"==typeof window)return e();window.createPageHandler=e}();"`; -exports[`split chunks on a project release results not include split chunks for [REDUNDANCY]: /build/DemoDetail/index.js 1`] = `"!function(){var e=function(){return(()=>{var e={999:(e,t,o)=>{e.exports=function(e,t,r){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,o(999);var n={onMenuPress(){this.$app.$def.showMenu()}};t.default=n;const a=t.default||e.exports,p=[\\"public\\",\\"protected\\",\\"private\\"];if(a.data&&p.some((function(e){return a[e]})))throw new Error('页面VM对象中的属性data不可与\\"'+p.join(\\",\\")+'\\"同时存在,请使用private替换data名称');a.data||(a.data={},a._descriptor={},p.forEach((function(e){const t=typeof a[e];if(\\"object\\"===t){a.data=Object.assign(a.data,a[e]);for(const t in a[e])a._descriptor[t]={access:e}}else\\"function\\"===t&&console.warn(\\"页面VM对象中的属性\\"+e+\\"的值不能是函数,请使用对象\\")})))}},999:e=>{e.exports=function(e,t,o){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,t.default={}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:(e,t,o)=>{var r=o(999);$app_define$(\\"@app-component/compa\\",[],(function(e,t,n){r(n,t,e),t.__esModule&&t.default&&(n.exports=t.default),n.exports.template=o(999)}))},999:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.add=function(e,t){return e+t}}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,o),a.exports}(()=>{o(999);var e=o(999);$app_define$(\\"@app-component/index\\",[],(function(t,r,n){e(n,r,t),r.__esModule&&r.default&&(n.exports=r.default),n.exports.template=o(999)})),$app_bootstrap$(\\"@app-component/index\\",{packagerVersion:\\"\\"})})()})()};if(\\"undefined\\"==typeof window)return e();window.createPageHandler=e}();"`; +exports[`split chunks on a project release results not include split chunks for [REDUNDANCY]: /build/DemoDetail/index.js 1`] = `"!function(){var e=function(){return(()=>{var e={999:(e,t,o)=>{e.exports=function(e,t,r){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,o(999);var n={onMenuPress(){this.$app.$def.showMenu()}};t.default=n;const a=t.default||e.exports,p=[\\"public\\",\\"protected\\",\\"private\\"];if(a.data&&p.some((function(e){return a[e]})))throw new Error('页面VM对象中的属性data不可与\\"'+p.join(\\",\\")+'\\"同时存在,请使用private替换data名称');a.data||(a.data={},a._descriptor={},p.forEach((function(e){const t=typeof a[e];if(\\"object\\"===t){a.data=Object.assign(a.data,a[e]);for(const t in a[e])a._descriptor[t]={access:e}}else\\"function\\"===t&&console.warn(\\"页面VM对象中的属性\\"+e+\\"的值不能是函数,请使用对象\\")})))}},999:e=>{e.exports=function(e,t,o){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,t.default={}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:(e,t,o)=>{var r=o(999);$app_define$(\\"@app-component/compa\\",[],(function(e,t,n){r(n,t,e),t.__esModule&&t.default&&(n.exports=t.default),n.exports.template=o(999)}))},999:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.add=function(e,t){return e+t}}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,o),a.exports}(()=>{o(999);var e=o(999);$app_define$(\\"@app-component/index\\",[],(function(t,r,n){e(n,r,t),r.__esModule&&r.default&&(n.exports=r.default),n.exports.template=o(999)})),$app_bootstrap$(\\"@app-component/index\\",{packagerVersion:void 0})})()})()};if(\\"undefined\\"==typeof window)return e();window.createPageHandler=e}();"`; -exports[`split chunks on a project release results not include split chunks for [REDUNDANCY]: /build/app.js 1`] = `"!function(){var e=function(){return(()=>{var e,o,t={999:(e,o,t)=>{e.exports=function(e,o,n){\\"use strict\\";t(999)}},999:(e,o)=>{\\"use strict\\";Object.defineProperty(o,\\"__esModule\\",{value:!0}),o.add=function(e,o){return e+o}},999:e=>{\\"use strict\\";e.exports=JSON.parse('{\\"package\\":\\"com.application.demo\\",\\"name\\":\\"lewis-demo\\",\\"versionName\\":\\"1.0.0\\",\\"versionCode\\":\\"1\\",\\"minPlatformVersion\\":1070,\\"icon\\":\\"/Common/logo.png\\",\\"features\\":[{\\"name\\":\\"system.prompt\\"},{\\"name\\":\\"system.router\\"},{\\"name\\":\\"system.shortcut\\"}],\\"permissions\\":[{\\"origin\\":\\"*\\"}],\\"config\\":{\\"logLevel\\":\\"trace\\"},\\"router\\":{\\"entry\\":\\"Demo\\",\\"pages\\":{\\"Demo\\":{\\"component\\":\\"index\\"},\\"DemoDetail\\":{\\"component\\":\\"index\\"},\\"About\\":{\\"component\\":\\"index\\"}}},\\"display\\":{\\"titleBarBackgroundColor\\":\\"#f2f2f2\\",\\"titleBarTextColor\\":\\"#414141\\",\\"menu\\":true,\\"pages\\":{\\"Demo\\":{\\"titleBarText\\":\\"示例页\\",\\"menu\\":false},\\"DemoDetail\\":{\\"titleBarText\\":\\"详情页\\"},\\"About\\":{\\"menu\\":false}}}}')}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}e={},o=r(999),$app_define$(\\"@app-application/app\\",[],(function(t,n,a){o(a,n,t),n.__esModule&&n.default&&(a.exports=n.default),a.exports.manifest=r(999),a.exports.style={list:[e]}})),$app_bootstrap$(\\"@app-application/app\\",{packagerVersion:\\"\\"})})()};if(\\"undefined\\"==typeof window)return e();window.createAppHandler=e,global.manifest={package:\\"com.application.demo\\",name:\\"lewis-demo\\",versionName:\\"1.0.0\\",versionCode:\\"1\\",minPlatformVersion:1070,icon:\\"/Common/logo.png\\",features:[{name:\\"system.prompt\\"},{name:\\"system.router\\"},{name:\\"system.shortcut\\"}],permissions:[{origin:\\"*\\"}],config:{logLevel:\\"trace\\"},router:{entry:\\"Demo\\",pages:{Demo:{component:\\"index\\"},DemoDetail:{component:\\"index\\"},About:{component:\\"index\\"}}},display:{titleBarBackgroundColor:\\"#f2f2f2\\",titleBarTextColor:\\"#414141\\",menu:!0,pages:{Demo:{titleBarText:\\"示例页\\",menu:!1},DemoDetail:{titleBarText:\\"详情页\\"},About:{menu:!1}}}}}();"`; +exports[`split chunks on a project release results not include split chunks for [REDUNDANCY]: /build/app.js 1`] = `"!function(){var e=function(){return(()=>{var e,o,t={999:(e,o,t)=>{e.exports=function(e,o,n){\\"use strict\\";t(999)}},999:(e,o)=>{\\"use strict\\";Object.defineProperty(o,\\"__esModule\\",{value:!0}),o.add=function(e,o){return e+o}},999:e=>{\\"use strict\\";e.exports=JSON.parse('{\\"package\\":\\"com.application.demo\\",\\"name\\":\\"lewis-demo\\",\\"versionName\\":\\"1.0.0\\",\\"versionCode\\":\\"1\\",\\"minPlatformVersion\\":1070,\\"icon\\":\\"/Common/logo.png\\",\\"features\\":[{\\"name\\":\\"system.prompt\\"},{\\"name\\":\\"system.router\\"},{\\"name\\":\\"system.shortcut\\"}],\\"permissions\\":[{\\"origin\\":\\"*\\"}],\\"config\\":{\\"logLevel\\":\\"trace\\"},\\"router\\":{\\"entry\\":\\"Demo\\",\\"pages\\":{\\"Demo\\":{\\"component\\":\\"index\\"},\\"DemoDetail\\":{\\"component\\":\\"index\\"},\\"About\\":{\\"component\\":\\"index\\"}}},\\"display\\":{\\"titleBarBackgroundColor\\":\\"#f2f2f2\\",\\"titleBarTextColor\\":\\"#414141\\",\\"menu\\":true,\\"pages\\":{\\"Demo\\":{\\"titleBarText\\":\\"示例页\\",\\"menu\\":false},\\"DemoDetail\\":{\\"titleBarText\\":\\"详情页\\"},\\"About\\":{\\"menu\\":false}}}}')}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}e={},o=r(999),$app_define$(\\"@app-application/app\\",[],(function(t,n,a){o(a,n,t),n.__esModule&&n.default&&(a.exports=n.default),a.exports.manifest=r(999),a.exports.style={list:[e]}})),$app_bootstrap$(\\"@app-application/app\\",{packagerVersion:void 0})})()};if(\\"undefined\\"==typeof window)return e();window.createAppHandler=e,global.manifest={package:\\"com.application.demo\\",name:\\"lewis-demo\\",versionName:\\"1.0.0\\",versionCode:\\"1\\",minPlatformVersion:1070,icon:\\"/Common/logo.png\\",features:[{name:\\"system.prompt\\"},{name:\\"system.router\\"},{name:\\"system.shortcut\\"}],permissions:[{origin:\\"*\\"}],config:{logLevel:\\"trace\\"},router:{entry:\\"Demo\\",pages:{Demo:{component:\\"index\\"},DemoDetail:{component:\\"index\\"},About:{component:\\"index\\"}}},display:{titleBarBackgroundColor:\\"#f2f2f2\\",titleBarTextColor:\\"#414141\\",menu:!0,pages:{Demo:{titleBarText:\\"示例页\\",menu:!1},DemoDetail:{titleBarText:\\"详情页\\"},About:{menu:!1}}}}}();"`; -exports[`split chunks on a project release results not include split chunks for [other value]: /build/About/index.js 1`] = `"!function(){var e=function(){return(()=>{var e={999:(e,t,o)=>{e.exports=function(e,t,r){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,o(999),t.default={};const n=t.default||e.exports,a=[\\"public\\",\\"protected\\",\\"private\\"];if(n.data&&a.some((function(e){return n[e]})))throw new Error('页面VM对象中的属性data不可与\\"'+a.join(\\",\\")+'\\"同时存在,请使用private替换data名称');n.data||(n.data={},n._descriptor={},a.forEach((function(e){const t=typeof n[e];if(\\"object\\"===t){n.data=Object.assign(n.data,n[e]);for(const t in n[e])n._descriptor[t]={access:e}}else\\"function\\"===t&&console.warn(\\"页面VM对象中的属性\\"+e+\\"的值不能是函数,请使用对象\\")})))}},999:e=>{e.exports=function(e,t,o){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,t.default={}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:(e,t,o)=>{var r=o(999);$app_define$(\\"@app-component/compb\\",[],(function(e,t,n){r(n,t,e),t.__esModule&&t.default&&(n.exports=t.default),n.exports.template=o(999)}))},999:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.multiply=function(e,t){return e*t}}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,o),a.exports}(()=>{o(999);var e=o(999);$app_define$(\\"@app-component/index\\",[],(function(t,r,n){e(n,r,t),r.__esModule&&r.default&&(n.exports=r.default),n.exports.template=o(999)})),$app_bootstrap$(\\"@app-component/index\\",{packagerVersion:\\"\\"})})()})()};if(\\"undefined\\"==typeof window)return e();window.createPageHandler=e}();"`; +exports[`split chunks on a project release results not include split chunks for [other value]: /build/About/index.js 1`] = `"!function(){var e=function(){return(()=>{var e={999:(e,t,o)=>{e.exports=function(e,t,r){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,o(999),t.default={};const n=t.default||e.exports,a=[\\"public\\",\\"protected\\",\\"private\\"];if(n.data&&a.some((function(e){return n[e]})))throw new Error('页面VM对象中的属性data不可与\\"'+a.join(\\",\\")+'\\"同时存在,请使用private替换data名称');n.data||(n.data={},n._descriptor={},a.forEach((function(e){const t=typeof n[e];if(\\"object\\"===t){n.data=Object.assign(n.data,n[e]);for(const t in n[e])n._descriptor[t]={access:e}}else\\"function\\"===t&&console.warn(\\"页面VM对象中的属性\\"+e+\\"的值不能是函数,请使用对象\\")})))}},999:e=>{e.exports=function(e,t,o){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,t.default={}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:(e,t,o)=>{var r=o(999);$app_define$(\\"@app-component/compb\\",[],(function(e,t,n){r(n,t,e),t.__esModule&&t.default&&(n.exports=t.default),n.exports.template=o(999)}))},999:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.multiply=function(e,t){return e*t}}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,o),a.exports}(()=>{o(999);var e=o(999);$app_define$(\\"@app-component/index\\",[],(function(t,r,n){e(n,r,t),r.__esModule&&r.default&&(n.exports=r.default),n.exports.template=o(999)})),$app_bootstrap$(\\"@app-component/index\\",{packagerVersion:void 0})})()})()};if(\\"undefined\\"==typeof window)return e();window.createPageHandler=e}();"`; -exports[`split chunks on a project release results not include split chunks for [other value]: /build/Demo/index.js 1`] = `"!function(){var e=function(){return(()=>{var e={999:(e,t,o)=>{e.exports=function(e,t,r){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,o(999),o(999),t.default={};const n=t.default||e.exports,a=[\\"public\\",\\"protected\\",\\"private\\"];if(n.data&&a.some((function(e){return n[e]})))throw new Error('页面VM对象中的属性data不可与\\"'+a.join(\\",\\")+'\\"同时存在,请使用private替换data名称');n.data||(n.data={},n._descriptor={},a.forEach((function(e){const t=typeof n[e];if(\\"object\\"===t){n.data=Object.assign(n.data,n[e]);for(const t in n[e])n._descriptor[t]={access:e}}else\\"function\\"===t&&console.warn(\\"页面VM对象中的属性\\"+e+\\"的值不能是函数,请使用对象\\")})))}},999:e=>{e.exports=function(e,t,o){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,t.default={}}},999:e=>{e.exports=function(e,t,o){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,t.default={}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:(e,t,o)=>{var r=o(999);$app_define$(\\"@app-component/compa\\",[],(function(e,t,n){r(n,t,e),t.__esModule&&t.default&&(n.exports=t.default),n.exports.template=o(999)}))},999:(e,t,o)=>{var r=o(999);$app_define$(\\"@app-component/compb\\",[],(function(e,t,n){r(n,t,e),t.__esModule&&t.default&&(n.exports=t.default),n.exports.template=o(999)}))},999:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.add=function(e,t){return e+t}},999:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.multiply=function(e,t){return e*t}}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,o),a.exports}(()=>{o(999),o(999);var e=o(999);$app_define$(\\"@app-component/index\\",[],(function(t,r,n){e(n,r,t),r.__esModule&&r.default&&(n.exports=r.default),n.exports.template=o(999)})),$app_bootstrap$(\\"@app-component/index\\",{packagerVersion:\\"\\"})})()})()};if(\\"undefined\\"==typeof window)return e();window.createPageHandler=e}();"`; +exports[`split chunks on a project release results not include split chunks for [other value]: /build/Demo/index.js 1`] = `"!function(){var e=function(){return(()=>{var e={999:(e,t,o)=>{e.exports=function(e,t,r){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,o(999),o(999),t.default={};const n=t.default||e.exports,a=[\\"public\\",\\"protected\\",\\"private\\"];if(n.data&&a.some((function(e){return n[e]})))throw new Error('页面VM对象中的属性data不可与\\"'+a.join(\\",\\")+'\\"同时存在,请使用private替换data名称');n.data||(n.data={},n._descriptor={},a.forEach((function(e){const t=typeof n[e];if(\\"object\\"===t){n.data=Object.assign(n.data,n[e]);for(const t in n[e])n._descriptor[t]={access:e}}else\\"function\\"===t&&console.warn(\\"页面VM对象中的属性\\"+e+\\"的值不能是函数,请使用对象\\")})))}},999:e=>{e.exports=function(e,t,o){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,t.default={}}},999:e=>{e.exports=function(e,t,o){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,t.default={}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:(e,t,o)=>{var r=o(999);$app_define$(\\"@app-component/compa\\",[],(function(e,t,n){r(n,t,e),t.__esModule&&t.default&&(n.exports=t.default),n.exports.template=o(999)}))},999:(e,t,o)=>{var r=o(999);$app_define$(\\"@app-component/compb\\",[],(function(e,t,n){r(n,t,e),t.__esModule&&t.default&&(n.exports=t.default),n.exports.template=o(999)}))},999:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.add=function(e,t){return e+t}},999:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.multiply=function(e,t){return e*t}}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,o),a.exports}(()=>{o(999),o(999);var e=o(999);$app_define$(\\"@app-component/index\\",[],(function(t,r,n){e(n,r,t),r.__esModule&&r.default&&(n.exports=r.default),n.exports.template=o(999)})),$app_bootstrap$(\\"@app-component/index\\",{packagerVersion:void 0})})()})()};if(\\"undefined\\"==typeof window)return e();window.createPageHandler=e}();"`; -exports[`split chunks on a project release results not include split chunks for [other value]: /build/DemoDetail/index.js 1`] = `"!function(){var e=function(){return(()=>{var e={999:(e,t,o)=>{e.exports=function(e,t,r){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,o(999);var n={onMenuPress(){this.$app.$def.showMenu()}};t.default=n;const a=t.default||e.exports,p=[\\"public\\",\\"protected\\",\\"private\\"];if(a.data&&p.some((function(e){return a[e]})))throw new Error('页面VM对象中的属性data不可与\\"'+p.join(\\",\\")+'\\"同时存在,请使用private替换data名称');a.data||(a.data={},a._descriptor={},p.forEach((function(e){const t=typeof a[e];if(\\"object\\"===t){a.data=Object.assign(a.data,a[e]);for(const t in a[e])a._descriptor[t]={access:e}}else\\"function\\"===t&&console.warn(\\"页面VM对象中的属性\\"+e+\\"的值不能是函数,请使用对象\\")})))}},999:e=>{e.exports=function(e,t,o){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,t.default={}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:(e,t,o)=>{var r=o(999);$app_define$(\\"@app-component/compa\\",[],(function(e,t,n){r(n,t,e),t.__esModule&&t.default&&(n.exports=t.default),n.exports.template=o(999)}))},999:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.add=function(e,t){return e+t}}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,o),a.exports}(()=>{o(999);var e=o(999);$app_define$(\\"@app-component/index\\",[],(function(t,r,n){e(n,r,t),r.__esModule&&r.default&&(n.exports=r.default),n.exports.template=o(999)})),$app_bootstrap$(\\"@app-component/index\\",{packagerVersion:\\"\\"})})()})()};if(\\"undefined\\"==typeof window)return e();window.createPageHandler=e}();"`; +exports[`split chunks on a project release results not include split chunks for [other value]: /build/DemoDetail/index.js 1`] = `"!function(){var e=function(){return(()=>{var e={999:(e,t,o)=>{e.exports=function(e,t,r){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,o(999);var n={onMenuPress(){this.$app.$def.showMenu()}};t.default=n;const a=t.default||e.exports,p=[\\"public\\",\\"protected\\",\\"private\\"];if(a.data&&p.some((function(e){return a[e]})))throw new Error('页面VM对象中的属性data不可与\\"'+p.join(\\",\\")+'\\"同时存在,请使用private替换data名称');a.data||(a.data={},a._descriptor={},p.forEach((function(e){const t=typeof a[e];if(\\"object\\"===t){a.data=Object.assign(a.data,a[e]);for(const t in a[e])a._descriptor[t]={access:e}}else\\"function\\"===t&&console.warn(\\"页面VM对象中的属性\\"+e+\\"的值不能是函数,请使用对象\\")})))}},999:e=>{e.exports=function(e,t,o){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=void 0,t.default={}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:e=>{e.exports={type:\\"div\\",attr:{}}},999:(e,t,o)=>{var r=o(999);$app_define$(\\"@app-component/compa\\",[],(function(e,t,n){r(n,t,e),t.__esModule&&t.default&&(n.exports=t.default),n.exports.template=o(999)}))},999:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.add=function(e,t){return e+t}}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,o),a.exports}(()=>{o(999);var e=o(999);$app_define$(\\"@app-component/index\\",[],(function(t,r,n){e(n,r,t),r.__esModule&&r.default&&(n.exports=r.default),n.exports.template=o(999)})),$app_bootstrap$(\\"@app-component/index\\",{packagerVersion:void 0})})()})()};if(\\"undefined\\"==typeof window)return e();window.createPageHandler=e}();"`; -exports[`split chunks on a project release results not include split chunks for [other value]: /build/app.js 1`] = `"!function(){var e=function(){return(()=>{var e,o,t={999:(e,o,t)=>{e.exports=function(e,o,n){\\"use strict\\";t(999)}},999:(e,o)=>{\\"use strict\\";Object.defineProperty(o,\\"__esModule\\",{value:!0}),o.add=function(e,o){return e+o}},999:e=>{\\"use strict\\";e.exports=JSON.parse('{\\"package\\":\\"com.application.demo\\",\\"name\\":\\"lewis-demo\\",\\"versionName\\":\\"1.0.0\\",\\"versionCode\\":\\"1\\",\\"minPlatformVersion\\":1070,\\"icon\\":\\"/Common/logo.png\\",\\"features\\":[{\\"name\\":\\"system.prompt\\"},{\\"name\\":\\"system.router\\"},{\\"name\\":\\"system.shortcut\\"}],\\"permissions\\":[{\\"origin\\":\\"*\\"}],\\"config\\":{\\"logLevel\\":\\"trace\\"},\\"router\\":{\\"entry\\":\\"Demo\\",\\"pages\\":{\\"Demo\\":{\\"component\\":\\"index\\"},\\"DemoDetail\\":{\\"component\\":\\"index\\"},\\"About\\":{\\"component\\":\\"index\\"}}},\\"display\\":{\\"titleBarBackgroundColor\\":\\"#f2f2f2\\",\\"titleBarTextColor\\":\\"#414141\\",\\"menu\\":true,\\"pages\\":{\\"Demo\\":{\\"titleBarText\\":\\"示例页\\",\\"menu\\":false},\\"DemoDetail\\":{\\"titleBarText\\":\\"详情页\\"},\\"About\\":{\\"menu\\":false}}}}')}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}e={},o=r(999),$app_define$(\\"@app-application/app\\",[],(function(t,n,a){o(a,n,t),n.__esModule&&n.default&&(a.exports=n.default),a.exports.manifest=r(999),a.exports.style={list:[e]}})),$app_bootstrap$(\\"@app-application/app\\",{packagerVersion:\\"\\"})})()};if(\\"undefined\\"==typeof window)return e();window.createAppHandler=e,global.manifest={package:\\"com.application.demo\\",name:\\"lewis-demo\\",versionName:\\"1.0.0\\",versionCode:\\"1\\",minPlatformVersion:1070,icon:\\"/Common/logo.png\\",features:[{name:\\"system.prompt\\"},{name:\\"system.router\\"},{name:\\"system.shortcut\\"}],permissions:[{origin:\\"*\\"}],config:{logLevel:\\"trace\\"},router:{entry:\\"Demo\\",pages:{Demo:{component:\\"index\\"},DemoDetail:{component:\\"index\\"},About:{component:\\"index\\"}}},display:{titleBarBackgroundColor:\\"#f2f2f2\\",titleBarTextColor:\\"#414141\\",menu:!0,pages:{Demo:{titleBarText:\\"示例页\\",menu:!1},DemoDetail:{titleBarText:\\"详情页\\"},About:{menu:!1}}}}}();"`; +exports[`split chunks on a project release results not include split chunks for [other value]: /build/app.js 1`] = `"!function(){var e=function(){return(()=>{var e,o,t={999:(e,o,t)=>{e.exports=function(e,o,n){\\"use strict\\";t(999)}},999:(e,o)=>{\\"use strict\\";Object.defineProperty(o,\\"__esModule\\",{value:!0}),o.add=function(e,o){return e+o}},999:e=>{\\"use strict\\";e.exports=JSON.parse('{\\"package\\":\\"com.application.demo\\",\\"name\\":\\"lewis-demo\\",\\"versionName\\":\\"1.0.0\\",\\"versionCode\\":\\"1\\",\\"minPlatformVersion\\":1070,\\"icon\\":\\"/Common/logo.png\\",\\"features\\":[{\\"name\\":\\"system.prompt\\"},{\\"name\\":\\"system.router\\"},{\\"name\\":\\"system.shortcut\\"}],\\"permissions\\":[{\\"origin\\":\\"*\\"}],\\"config\\":{\\"logLevel\\":\\"trace\\"},\\"router\\":{\\"entry\\":\\"Demo\\",\\"pages\\":{\\"Demo\\":{\\"component\\":\\"index\\"},\\"DemoDetail\\":{\\"component\\":\\"index\\"},\\"About\\":{\\"component\\":\\"index\\"}}},\\"display\\":{\\"titleBarBackgroundColor\\":\\"#f2f2f2\\",\\"titleBarTextColor\\":\\"#414141\\",\\"menu\\":true,\\"pages\\":{\\"Demo\\":{\\"titleBarText\\":\\"示例页\\",\\"menu\\":false},\\"DemoDetail\\":{\\"titleBarText\\":\\"详情页\\"},\\"About\\":{\\"menu\\":false}}}}')}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}e={},o=r(999),$app_define$(\\"@app-application/app\\",[],(function(t,n,a){o(a,n,t),n.__esModule&&n.default&&(a.exports=n.default),a.exports.manifest=r(999),a.exports.style={list:[e]}})),$app_bootstrap$(\\"@app-application/app\\",{packagerVersion:void 0})})()};if(\\"undefined\\"==typeof window)return e();window.createAppHandler=e,global.manifest={package:\\"com.application.demo\\",name:\\"lewis-demo\\",versionName:\\"1.0.0\\",versionCode:\\"1\\",minPlatformVersion:1070,icon:\\"/Common/logo.png\\",features:[{name:\\"system.prompt\\"},{name:\\"system.router\\"},{name:\\"system.shortcut\\"}],permissions:[{origin:\\"*\\"}],config:{logLevel:\\"trace\\"},router:{entry:\\"Demo\\",pages:{Demo:{component:\\"index\\"},DemoDetail:{component:\\"index\\"},About:{component:\\"index\\"}}},display:{titleBarBackgroundColor:\\"#f2f2f2\\",titleBarTextColor:\\"#414141\\",menu:!0,pages:{Demo:{titleBarText:\\"示例页\\",menu:!1},DemoDetail:{titleBarText:\\"详情页\\"},About:{menu:!1}}}}}();"`; diff --git a/packages/hap-toolkit/src/gen-webpack-conf/index.js b/packages/hap-toolkit/src/gen-webpack-conf/index.js index dc9b0116..c850cabd 100644 --- a/packages/hap-toolkit/src/gen-webpack-conf/index.js +++ b/packages/hap-toolkit/src/gen-webpack-conf/index.js @@ -3,9 +3,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { sync as resolveSync } from 'resolve' import path from 'path' import fs from 'fs-extra' +import { sync as resolveSync } from 'resolve' import webpack from 'webpack' import { readJson, @@ -143,13 +143,10 @@ export default async function genWebpackConf(launchOptions, mode) { // 平台:native NODE_PLATFORM: process.env.NODE_PLATFORM, // 阶段: dev|test|release - NODE_PHASE: process.env.NODE_PHASE - } - if (launchOptions.compileOptions) { - Object.assign(env, { - NODE_ENV: launchOptions.compileOptions.defineOptions.NODE_ENV - }) + NODE_PHASE: process.env.NODE_PHASE, + NODE_ENV: launchOptions.compileOptions?.defineOptions.NODE_ENV } + colorconsole.info(`配置环境:${JSON.stringify(env)}`) const definePluginOptions = { @@ -163,26 +160,25 @@ export default async function genWebpackConf(launchOptions, mode) { // 服务器地址 QUICKAPP_SERVER_HOST: JSON.stringify(getDefaultServerHost()), QUICKAPP_TOOLKIT_VERSION: JSON.stringify( - fs.readJSONSync(resolveSync('../../package.json')).version + await fs.readJSON(resolveSync('../../package.json')).version ) } if (launchOptions.compileOptions) { const defineOptions = launchOptions.compileOptions.defineOptions - Object.assign(definePluginOptions, { - 'process.env.NODE_ENV': JSON.stringify(defineOptions.NODE_ENV) - }) + definePluginOptions['process.env.NODE_ENV'] = JSON.stringify(defineOptions.NODE_ENV) if (defineOptions.OTHER_VARIABLES) { - let compileObj = {} const options = defineOptions.OTHER_VARIABLES.split('&') - for (let i = 0; i < options.length; i++) { - const item = options[i].split('=') - compileObj[item[0]] = item[1] - } - Object.assign(definePluginOptions, compileObj) + options.forEach((str) => { + const [k, v] = str.split('=') + definePluginOptions[k] = v + }) } } + globalConfig.isSmartMode = + compileOptionsObject.splitChunksMode === compileOptionsMeta.splitChunksModeEnum.SMART + const webpackConf = { context: cwd, mode, @@ -257,131 +253,135 @@ export default async function genWebpackConf(launchOptions, mode) { version: false, assets: false }, - optimization: {} - } - - // 设置抽取公共js - if (compileOptionsObject.splitChunksMode === compileOptionsMeta.splitChunksModeEnum.SMART) { - colorconsole.warn( - `启用 splitChunksMode: "SMART" 模式, 请确保平台版本 >= ${SPLIT_CHUNKS_SUPPORT_VERSION_FROM}` - ) - // 当前仅smart模式才启用 - webpackConf.optimization.splitChunks = { - minSize: 1, - cacheGroups: { - default: false, - defaultVendors: { - test: /[\\/]node_modules[\\/]/, - chunks(chunk) { - // 获取需要chunk的模块,卡片模块暂不支持提取公共chunk - const widgetsConf = manifest.router.widgets || {} - return !Object.keys(widgetsConf).some( - (item) => chunk.name.replace(/\\/g, '/').indexOf(item.replace(/\\/g, '/')) !== -1 - ) - }, - minChunks: 2, - name(module) { - // 处理node_modules的chunk位置为node_modules下的路径,通过name来控制,如node_modules/vue/dist/vue.runtime.esm; - const index = module.resource.indexOf('node_modules') - const chunkPath = module.resource - .slice(index) - .replace(/(.+)\.\w\??(.+)?/, ($0, $1) => $1) - // 兼容windows上的路径 - return chunkPath.replace(/\\/g, '/').split(path.sep).join('/') - }, - priority: 2, - reuseExistingChunk: true, - enforce: true - }, - // 用于抽离出app.ux引入的组件或者文件 - appPkg: { - test(module, { chunkGraph }) { - function isAppRequire(module, chunkGraph) { - let result = false - chunkGraph.getModuleChunksIterable(module).forEach((chunk) => { - if (chunk.name === 'app') { - result = true - return false - } - }) - return result - } + optimization: { + // 设置抽取公共js, 当前仅smart模式才启用 + splitChunks: globalConfig.isSmartMode + ? { + minSize: 1, + cacheGroups: { + default: false, + defaultVendors: { + test: /[\\/]node_modules[\\/]/, + chunks(chunk) { + // 获取需要chunk的模块,卡片模块暂不支持提取公共chunk + const widgetsConf = manifest.router.widgets || {} + return !Object.keys(widgetsConf).some( + (item) => + chunk.name.replace(/\\/g, '/').indexOf(item.replace(/\\/g, '/')) !== -1 + ) + }, + minChunks: 2, + name(module) { + // 处理node_modules的chunk位置为node_modules下的路径,通过name来控制,如node_modules/vue/dist/vue.runtime.esm; + const index = module.resource.indexOf('node_modules') + const chunkPath = module.resource + .slice(index) + .replace(/(.+)\.\w\??(.+)?/, ($0, $1) => $1) + // 兼容windows上的路径 + return chunkPath.replace(/\\/g, '/').split(path.sep).join('/') + }, + priority: 2, + reuseExistingChunk: true, + enforce: true + }, + // 用于抽离出app.ux引入的组件或者文件 + appPkg: { + test(module, { chunkGraph }) { + function isAppRequire(module, chunkGraph) { + let result = false + chunkGraph.getModuleChunksIterable(module).forEach((chunk) => { + if (chunk.name === 'app') { + result = true + return false + } + }) + return result + } - function isUxPath(module) { - // require.context引入的是ContextModule不含有resource - if (!module.resource) return false - const queryStriped = module.resource.split('?').shift() - return path.extname(queryStriped) === '.ux' - } + function isUxPath(module) { + // require.context引入的是ContextModule不含有resource + if (!module.resource) return false + const queryStriped = module.resource.split('?').shift() + return path.extname(queryStriped) === '.ux' + } - if (isAppRequire(module, chunkGraph) && isUxPath(module)) { - return true - } + if (isAppRequire(module, chunkGraph) && isUxPath(module)) { + return true + } - return false - }, - chunks: 'all', - name(module) { - // 处理正常chunk的位置为相对src下的路径,通过name来控制,如Common/a; - const sourcePath = path.join(globalConfig.projectPath, globalConfig.sourceRoot) - const chunkPath = module.resource - .slice(sourcePath.length + 1) - .replace(/(.+)\.\w\??(.+)?/, ($0, $1) => $1) - // 兼容windows上的路径 - return chunkPath.replace(/\\/g, '/').split(path.sep).join('/') - }, - // 优先级最低 - priority: 1, - // 只要app.ux引入即被抽离 - minChunks: 1, - reuseExistingChunk: true, - enforce: true - }, - chunks: { - test(module) { - // 过滤掉自定义module,比如抽取css生成*.css.json使用的CssModule - if (module.constructor.name !== 'NormalModule') { - return false + return false + }, + chunks: 'all', + name(module) { + // 处理正常chunk的位置为相对src下的路径,通过name来控制,如Common/a; + const sourcePath = path.join(globalConfig.projectPath, globalConfig.sourceRoot) + const chunkPath = module.resource + .slice(sourcePath.length + 1) + .replace(/(.+)\.\w\??(.+)?/, ($0, $1) => $1) + // 兼容windows上的路径 + return chunkPath.replace(/\\/g, '/').split(path.sep).join('/') + }, + // 优先级最低 + priority: 1, + // 只要app.ux引入即被抽离 + minChunks: 1, + reuseExistingChunk: true, + enforce: true + }, + chunks: { + test(module) { + // 过滤掉自定义module,比如抽取css生成*.css.json使用的CssModule + if (module.constructor.name !== 'NormalModule') { + return false + } + return true + }, + chunks(chunk) { + // 获取需要chunk的模块,卡片模块暂不支持提取公共chunk + const widgetsConf = manifest.router.widgets || {} + return !Object.keys(widgetsConf).some( + (item) => + chunk.name.replace(/\\/g, '/').indexOf(item.replace(/\\/g, '/')) !== -1 + ) + }, + minChunks: 2, + name(module) { + // 处理正常chunk的位置为相对src下的路径,通过name来控制,如Common/a; + const sourcePath = path.join(globalConfig.projectPath, globalConfig.sourceRoot) + const chunkPath = module.resource + .slice(sourcePath.length + 1) + .replace(/(.+)\.\w\??(.+)?/, ($0, $1) => $1) + // 兼容windows上的路径 + return chunkPath.replace(/\\/g, '/').split(path.sep).join('/') + }, + priority: 1, + reuseExistingChunk: true, + enforce: true + }, + async: { + chunks: 'async', + name(module) { + const sourcePath = path.join(globalConfig.projectPath, globalConfig.sourceRoot) + const chunkPath = module.resource + .slice(sourcePath.length + 1) + .replace(/(.+)\.\w\??(.+)?/, ($0, $1) => $1) + // 兼容windows上的路径 + return chunkPath.replace(/\\/g, '/').split(path.sep).join('/') + }, + priority: 3, + enforce: true + } } - return true - }, - chunks(chunk) { - // 获取需要chunk的模块,卡片模块暂不支持提取公共chunk - const widgetsConf = manifest.router.widgets || {} - return !Object.keys(widgetsConf).some( - (item) => chunk.name.replace(/\\/g, '/').indexOf(item.replace(/\\/g, '/')) !== -1 - ) - }, - minChunks: 2, - name(module) { - // 处理正常chunk的位置为相对src下的路径,通过name来控制,如Common/a; - const sourcePath = path.join(globalConfig.projectPath, globalConfig.sourceRoot) - const chunkPath = module.resource - .slice(sourcePath.length + 1) - .replace(/(.+)\.\w\??(.+)?/, ($0, $1) => $1) - // 兼容windows上的路径 - return chunkPath.replace(/\\/g, '/').split(path.sep).join('/') - }, - priority: 1, - reuseExistingChunk: true, - enforce: true - }, - async: { - chunks: 'async', - name(module) { - const sourcePath = path.join(globalConfig.projectPath, globalConfig.sourceRoot) - const chunkPath = module.resource - .slice(sourcePath.length + 1) - .replace(/(.+)\.\w\??(.+)?/, ($0, $1) => $1) - // 兼容windows上的路径 - return chunkPath.replace(/\\/g, '/').split(path.sep).join('/') - }, - priority: 3, - enforce: true - } - } + } + : undefined } } + + if (globalConfig.isSmartMode) { + colorconsole.warn( + `启用 splitChunksMode: "SMART" 模式, 请确保平台版本 >= ${SPLIT_CHUNKS_SUPPORT_VERSION_FROM}` + ) + } const dslName = getProjectDslName(cwd) if (dslName === 'vue') { @@ -392,7 +392,14 @@ export default async function genWebpackConf(launchOptions, mode) { } // 加载其他模块的 webpack 配置 - const postHookList = [packagerPostHook, xvmPostHook, idePostHook] + const postHookList = [ + packagerPostHook, + xvmPostHook, + idePostHook, + // 增加项目目录的postHook机制 + quickappConfig?.postHook + ].filter(Boolean) + const { package: appPackageName, icon: appIcon, @@ -402,7 +409,8 @@ export default async function genWebpackConf(launchOptions, mode) { workers, banner = '' } = manifest - postHookList.forEach((postHook) => { + + for (const postHook of postHookList) { postHook( webpackConf, { @@ -426,11 +434,6 @@ export default async function genWebpackConf(launchOptions, mode) { }, quickappConfig ) - }) - - // 增加项目目录的postHook机制 - if (quickappConfig && quickappConfig.postHook) { - quickappConfig.postHook(webpackConf, compileOptionsObject) } // 设置 sourcemap 类型