UNPKG

fa-toolkit

Version:

a devtool for fast app

1 lines 8.23 kB
"use strict";var _0x36dde1=_0x297a;function _typeof(e){var t=_0x297a;return(_typeof=t(393)==typeof Symbol&&t(351)==typeof Symbol[t(372)]?function(e){return typeof e}:function(e){var a=t;return e&&a(393)==typeof Symbol&&e[a(385)]===Symbol&&e!==Symbol.prototype?a(351):typeof e})(e)}function _0x1707(){var e=["disableSubpackages",'.js"',"match","chunks","4350066LwTalz","defineProperty","filter","$app_define$","PROCESS_ASSETS_STAGE_DEV_TOOLING","source","key","PROCESS_ASSETS_STAGE_OPTIMIZE","name","forEach","object","value","chunkGraph","__quickappGlobal.chunkFileMap = __quickappGlobal.chunkFileMap || {","../common/utils","webpack-sources","337011LsaPLH","entry","$app_define_wrap$","ConcatSource","module","__webpack_require__","$app_bootstrap$","isArray","includes","symbol","map","length","resource","{ fulfilled = false; $app_evaluate$(`${__quickappGlobal.chunkFileMap[depId]}`); }","outputPath","sep","replace","getChunkEntryModulesIterable","10377792dTKbKc","base","standalone","3837216cPUAGh","8mAGFNd","564pDQVRa","groupsIterable","exports","$app_evaluate$(`${__quickappGlobal.chunkFileMap[chunkId]}`);loadingEnded();","enumerable","string","concat","iterator","path","tap","default","subpackages","webpack/lib/Compilation","build","configurable","page-chunks.json","$1.call(","1444833Uxuyey","join","assets","constructor","20695DdXrgN","add","hooks","processAssets","from","reduce","prototype","function","quickAppConfig","toPrimitive",".js","$app_require$","$1, ","\n\n\t\t\t\t\t","writable","options","@@toPrimitive must return a primitive value.","__quickappGlobal","optimizeChunkIds","global","files","compilation","keys","721138QFHFeE","call","var __quickappGlobal = Object.getPrototypeOf(global) || global;\n"];return(_0x1707=function(){return e})()}function _classCallCheck(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,a){for(var t=_0x297a,r=0;r<a.length;r++){var n=a[r];n[t(369)]=n.enumerable||!1,n[t(379)]=!0,t(427)in n&&(n[t(400)]=!0),Object[t(417)](e,_toPropertyKey(n[t(422)]),n)}}function _createClass(e,a,t){var r=_0x297a;return a&&_defineProperties(e[r(392)],a),t&&_defineProperties(e,t),Object[r(417)](e,r(392),{writable:!1}),e}function _defineProperty(e,a,t){return(a=_toPropertyKey(a))in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}function _toPropertyKey(e){var a=_0x297a,e=_toPrimitive(e,a(370));return _typeof(e)===a(351)?e:String(e)}function _toPrimitive(e,a){var t=_0x297a;if(_typeof(e)!==t(426)||null===e)return e;var r=e[Symbol[t(395)]];if(void 0===r)return("string"===a?String:Number)(e);a=r[t(410)](e,a||t(375));if(_typeof(a)!==t(426))return a;throw new TypeError(t(402))}!function(){for(var e=_0x297a,a=_0x1707();;)try{if(496641==+parseInt(e(432))+-parseInt(e(409))/2+parseInt(e(382))/3+parseInt(e(363))/4+-parseInt(e(386))/5*(parseInt(e(365))/6)+-parseInt(e(416))/7*(-parseInt(e(364))/8)+-parseInt(e(360))/9)break;a.push(a.shift())}catch(e){a.push(a.shift())}}();var path=require(_0x36dde1(373)),Compilation=require(_0x36dde1(377)),webpackSources=require(_0x36dde1(431)),utils=require("./utils"),SEP=path[_0x36dde1(357)],SPLIT_CHUNKS_PAGE_NAME=_0x36dde1(380),SPLIT_CHUNKS_APP_NAME="app-chunks.json",MAIN_PKG_NAME=_0x36dde1(361),pluginName="splitChunksAdaptPlugin",_require=require(_0x36dde1(430)),quickAppConfig=_require[_0x36dde1(394)],_quickAppConfig$outpu=quickAppConfig[_0x36dde1(356)],outputPath=void 0===_quickAppConfig$outpu?_0x36dde1(378):_quickAppConfig$outpu,actualModuleRequireParam=["module.exports",_0x36dde1(346),"module.exports",_0x36dde1(347)],moduleRequireNativeFunctions=[_0x36dde1(419),_0x36dde1(348),_0x36dde1(397),_0x36dde1(434)],appModuleRequireNativeFunctions=[_0x36dde1(419),_0x36dde1(348),_0x36dde1(397),_0x36dde1(434)],pageActualParamStr=actualModuleRequireParam[_0x36dde1(371)](moduleRequireNativeFunctions)[_0x36dde1(383)](", "),appActualParamStr=actualModuleRequireParam[_0x36dde1(371)](appModuleRequireNativeFunctions)[_0x36dde1(383)](", "),pageFormalParamStr=moduleRequireNativeFunctions.join(", "),appFormalParamStr=appModuleRequireNativeFunctions[_0x36dde1(383)](", "),quickappGlobal=_0x36dde1(411);function _0x297a(e,a){var t=_0x1707();return(_0x297a=function(e,a){return t[e-=345]})(e,a)}function replaceWindowWithGlobalStr(e,a){var t=_0x36dde1,e=t(e?405:403);return a.replace(/window(?=\["webpackChunk\w+"\])/g,e)}function getSubInfo(e,a){var t=Object[_0x36dde1(408)](e).find(function(e){return a.startsWith(e+SEP)});return t?e[t]:e[MAIN_PKG_NAME]}function updateChunksJson(e,a){var t=_0x36dde1;return e[a[t(354)]]={resource:a[t(354)],jsonFilePath:a.resource+SEP+SPLIT_CHUNKS_PAGE_NAME,standalone:a.standalone,chunks:{}},e}function createChunksJsonInfo(e){var a=_0x36dde1,t=(_defineProperty(t={},SPLIT_CHUNKS_APP_NAME,{jsonFilePath:SPLIT_CHUNKS_APP_NAME,chunks:{}}),_defineProperty(t,SPLIT_CHUNKS_PAGE_NAME,{jsonFilePath:SPLIT_CHUNKS_PAGE_NAME,chunks:{}}),t);return e&&(t[MAIN_PKG_NAME]={resource:MAIN_PKG_NAME,jsonFilePath:MAIN_PKG_NAME+SEP+SPLIT_CHUNKS_PAGE_NAME,chunks:{}},t=e[a(391)](updateChunksJson,t)),t}var SplitChunksAdaptPlugin=function(){function t(e){var a=_0x297a;_classCallCheck(this,t),this[a(401)]=e}return _createClass(t,[{key:"apply",value:function(t){var a=_0x297a,r=this;t.hooks[a(407)].tap(pluginName,function(s){var i,n=a,e=r.options;!e[n(412)]&&e[n(376)]&&0<e.subpackages[n(353)]&&(i=e.subpackages);var p=new Set,_=[],c="";s.hooks[n(404)][n(374)](pluginName,function(e){var r=n;_=utils.getEntryFiles(t.options[r(433)]);var a=Array[r(390)](e)[r(418)](function(e){var a=r;return!_[a(350)](""[a(371)](e.name,a(396)))})[r(352)](function(e){var a=r;return'"'[a(371)](e.id,'": "')[a(371)](e[a(424)],a(413))});c=r(429)[r(371)](a[r(383)](", "),"};"),e[r(425)](function(e){var a=r,t=Array.from(s.chunkGraph[a(359)](e));e[a(424)]&&e[a(424)][a(414)](/\bapp$/)&&Array.isArray(t)&&t[0]&&(e[a(366)][a(425)](function(e){var t=a;e.chunks[t(425)](function(e){var a=t;p[a(387)]("".concat(e[a(424)],a(396)))})}),p.delete("app.js"))})}),s[n(388)][n(389)][n(374)]({name:pluginName,stage:Compilation[n(423)]},function(){s.chunks.forEach(function(i){var p=_0x297a;i.files[p(425)](function(e){var a,t,r,n,o,u=p;e.match(/\.js$/)&&(a=(o=e[u(414)](/\bapp\.js$/))?appActualParamStr:pageActualParamStr,t=o?appFormalParamStr:pageFormalParamStr,r=!1,n=s[u(384)][e][u(421)](),o=Array[u(390)](s[u(428)].getChunkEntryModulesIterable(i)),Array[u(349)](o)&&o[0]?n=n[u(358)](/\/\/\s+webpackBootstrap/,function(e){var a=u;return""[a(371)](e,a(399)).concat(quickappGlobal,"\n\t\t\t\t\t")[a(371)](c,"\n")}):r=!0,n=(n=(n=(n=(n=(n=replaceWindowWithGlobalStr(r,n))[u(358)](/(?<=(if\(installedChunks\[depId\]\s+!==\s+0\)\s+))fulfilled\s+=\s+false;/,u(355))).replace(/__webpack_require__\.l\(url, loadingEnded,.+\)/g,u(368))).replace(/(__webpack_modules__\[moduleId\])\(\s*module,\s*module\.exports,\s*__webpack_require__/gm,u(381)[u(371)](a)))[u(358)](/(\(\(__unused_webpack_module,\s+(exports|__webpack_exports__)(,\s+__webpack_require__)?)/g,u(398)[u(371)](t)))[u(358)](/var\s*script\s*=\s*document\.createElement\('script'\);([\s|\S])+?document\.head\.appendChild\(script\);/,"$app_evaluate$(`${__quickappGlobal.chunkFileMap[chunkId]}`);\n/******/\t\t\t\treturn Promise.all(promises);"),s[u(384)][e]=new webpackSources[u(345)](n))})})}),s.hooks.processAssets.tap({name:pluginName,stage:Compilation[n(420)]},function(){var e,a,t,r=n,u=createChunksJsonInfo(i);for(e in s[r(415)].forEach(function(e){var a=r;e[a(406)].forEach(function(r){var n,o=a;r[o(414)](/\.js$/)&&!_[o(350)](r)&&(n=s[o(384)][r][o(421)](),p.has(r)?u[SPLIT_CHUNKS_APP_NAME].chunks[r]=n:(u[SPLIT_CHUNKS_PAGE_NAME][o(415)][r]=n,i&&s.chunkGroups[o(425)](function(e){var a,t=o;e.chunks.map(function(e){return""[_0x297a(371)](e.name,".js")})[t(350)](r)&&(a=e[t(401)].name||"",a=(e=getSubInfo(u,a))[t(354)],e[t(362)]?u[a][t(415)]=u[SPLIT_CHUNKS_PAGE_NAME][t(415)]:u[a][t(415)][r]=n)})),delete s[o(384)][r],e[o(406)]=[])})}),u)Object[r(392)].hasOwnProperty[r(410)](u,e)&&(a=u[e][r(415)],utils.isEmptyObject(a)||(t=u[e].jsonFilePath,s[r(384)][""[r(371)](outputPath)[r(371)](SEP)[r(371)](t)]=new webpackSources[r(345)](JSON.stringify(a))))})})}}]),t}();module[_0x36dde1(367)]=SplitChunksAdaptPlugin;