@flatjs/evolve 1.5.21 → 1.5.22

Sign up to get free protection for your applications and to get access to all the features.
package/cjs/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  /*! @flatjs/forge MIT @flatjs/evolve */
2
- "use strict";var e=require("@flatjs/common");var t=require("lodash");var n=require("@flatjs/mock");var r=require("babel-merge");var s=require("path");var o=require("@flatjs/forge-plugin-postcss-pixel");var i=require("cssnano");var a=require("webpack");var l=require("mini-css-extract-plugin");var c=require("chalk");var p=require("image-minimizer-webpack-plugin");var u=require("terser-webpack-plugin");var d=require("@pmmmwh/react-refresh-webpack-plugin");var m=require("case-sensitive-paths-webpack-plugin");var f=require("fork-ts-checker-webpack-plugin");var h=require("webpack-bundle-analyzer");var v=require("webpack-sources");var g=require("webpack/lib/util/extractUrlAndGlobal");var b=require("html-webpack-plugin");var y=require("webpack-dev-server");var w=require("express");var j=require("https");var C=require("fs");var k=require("better-opn");function S(e){let t;const n=process.env.NODE_ENV==="FLATJS_CORE";switch(e){case"@flatjs/evolve-preset-babel":t=require.resolve(n?"../../../evolve-preset-babel/src/index":e);break}return t}const P=(e,t=false)=>{if(!t){return require(e)}else{return n.loadModule(e)}};const O=(t={usePreset:"react"},n=[])=>{const{usePreset:s,...o}=t;const i=n.map((e=>[require.resolve("babel-plugin-import"),{transformToDefaultImport:false,libraryDirectory:"cjs",style:()=>false,...e},e.libraryName]));const{reactBabelPreset:a,infernoBabelPreset:l,vueBabelPreset:c}=P(S("@flatjs/evolve-preset-babel"));const p=s==="react"?a():s==="vue"?c():l();let u={};try{u=r(p,o);if(u.plugins){u.plugins.unshift(...i)}else{u.plugins=i}}catch(t){e.printError(t)}return Object.assign({babelrc:false},u)};const x=[`https://polyfill.io/v3/polyfill.min.js?features=Array.from%2CArray.isArray%2CArray.of%2CArray.prototype.entries%2CArray.prototype.every%2CArray.prototype.fill%2CArray.prototype.filter%2CArray.prototype.find%2CArray.prototype.findIndex%2CArray.prototype.flat%2CArray.prototype.forEach%2CArray.prototype.flatMap%2CArray.prototype.keys%2CArray.prototype.indexOf%2CArray.prototype.includes%2CArray.prototype.lastIndexOf%2CArray.prototype.map%2CArray.prototype.reduce%2CArray.prototype.reduceRight%2CArray.prototype.some%2CArray.prototype.sort%2CArray.prototype.values%2CArrayBuffer%2CBlob%2CDataView%2CDate.now%2CObject.assign%2CObject.create%2CObject.defineProperties%2CObject.defineProperty%2CObject.entries%2CObject.freeze%2CObject.fromEntries%2CObject.getOwnPropertySymbols%2CObject.getOwnPropertyNames%2CObject.getOwnPropertyDescriptors%2CObject.getOwnPropertyDescriptor%2CObject.getPrototypeOf%2CObject.is%2CObject.isExtensible%2CObject.isFrozen%2CObject.isSealed%2CObject.keys%2CObject.values%2CObject.setPrototypeOf%2CPromise%2CPromise.prototype.finally%2CReflect%2CReflect.apply%2CReflect.construct%2CReflect.defineProperty%2CReflect.deleteProperty%2CReflect.getPrototypeOf%2CReflect.getOwnPropertyDescriptor%2CReflect.get%2CReflect.ownKeys%2CReflect.isExtensible%2CReflect.has%2CReflect.preventExtensions%2CReflect.set%2CReflect.setPrototypeOf%2CSet%2CString.prototype.trimStart%2CString.prototype.trimEnd%2CString.prototype.trim%2CString.prototype.startsWith%2CString.prototype.repeat%2CString.prototype.replaceAll%2CString.prototype.padStart%2CString.prototype.padEnd%2CMap%2CObject.seal%2Cconsole.groupEnd%2Cconsole.group`];const A={reactDev:[`https://unpkg.com/react@18.2.0/umd/react.development.js`,`https://unpkg.com/react-dom@18.2.0/umd/react-dom.development.js`],reactProd:[`https://unpkg.com/react@18.2.0/umd/react.production.min.js`,`https://unpkg.com/react-dom@18.2.0/umd/react-dom.production.min.js`]};const B={reactDev:[`https://cdn.jsdelivr.net/npm/react@18.2.0/umd/react.development.js`,`https://cdn.jsdelivr.net/npm/react-dom@18.2.0/umd/react-dom.development.js`],reactProd:[`https://cdn.jsdelivr.net/npm/react@18.2.0/umd/react.production.min.js`,`https://cdn.jsdelivr.net/npm/react-dom@18.2.0/umd/react-dom.production.min.js`]};const E={reactDev:[`https://cdn.bootcdn.net/ajax/libs/react/18.2.0/umd/react.development.js`,`https://cdn.bootcdn.net/ajax/libs/react-dom/18.2.0/umd/react-dom.development.js`],reactProd:[`https://cdn.bootcdn.net/ajax/libs/react/18.2.0/umd/react.production.min.js`,`https://cdn.bootcdn.net/ajax/libs/react-dom/18.2.0/umd/react-dom.production.min.js`]};const $={flatjsEvolve:{projectCwd:process.cwd(),projectVirtualPath:"flatjs/evolve",forBuild:{rejectWarnings:false},forServe:{pageMiddlewares:[],defaultServeGlobalData:()=>({})},target:["web","es5"],liveReload:false,minimizeTerserOptions:{},multiHtmlCdn:{},watchOptions:{poll:1e3,ignored:/node_modules/,aggregateTimeout:500},extraPlugins:()=>[],pluginLoaderOptions:{babelOptions:{usePreset:"react"},lessOptions:{},cssnanoOptions:{},pixelOptions:{enabled:true,rootValue:{px:100,rpx:1},outputUnit:"rem"},enableBundleHashName:true,modularImports:[]}}};const M=(e,n={},r)=>{var s,o,i;const a=r[1];const l={vue:"Vue",react:"React","react-dom":"ReactDOM"};const c=t.isFunction(n)?n(e):n;const p=t.isFunction((s=a.options)==null?void 0:s.externals)?(o=a.options)==null?void 0:o.externals(e):(i=a.options)==null?void 0:i.externals;return Object.assign({},l,c,p||{})};const q=`(function(d){var j;var b=1;var i=1;var h=750;var c=100;function e(s,o){var q=d.document;var l=q.documentElement;var k=navigator.userAgent;var m=k.toLowerCase().indexOf("android")>-1;i=d.devicePixelRatio||1;if(i>3){i=3}if(m){i=1}console.log("current devicePixelRatio:",i);l.setAttribute("data-dpr",i.toString());var p=q.querySelector('meta[name="viewport"]');if(!p){b=1/i;p=q.createElement("meta");p.setAttribute("name","viewport");q.head.appendChild(p);p.setAttribute(["content","width=device-width,user-scalable=no,initial-scale=",b,",maximum-scale=",b,",minimum-scale=",b].join(""))}function n(){var t=document.documentElement.clientWidth;j=t/o*(s/i)*i;q.documentElement.style.fontSize=String(j)+"px"}var r;d.addEventListener("resize",function(){clearTimeout(r);r=setTimeout(n,300)},false);d.addEventListener("onload",n,false);n()}e(c,h);window.fabricViewport={currRem:j,currDpr:i,currScale:b,dpiPX2px:function f(k){return parseFloat(k.toString())/j*100+"px"},px2DPIpx:function a(k){return parseFloat(k.toString())/100*j+"px"},px2rem:function g(k){return parseFloat(k.toString())/100+"rem"}}})(window);`;const F={title:"",favicon:"",inlineScripts:()=>[],headBeforeStyles:()=>[],headBeforeScripts:e=>[...x,...e==="development"?E.reactDev:E.reactProd],bodyAfterScripts:()=>[],viewport:q,excludeCdnEnvs:["me","dev","ntv"],minify:true,template:s.join(e.getPackageDirSync(__dirname,""),"templates/html-plugin/index-{0}.html")};const D=(e,n,r)=>{let s;if(r){s=typeof r==="function"?r(n):r}if(t.isUndefined(s)){const t=F[e];return typeof t==="function"?t(n):t}return s};const R=(e,t)=>Object.assign({sourceMap:e,javascriptEnabled:true},t);const T=(e,t={},n={})=>{const r=[i({preset:["default",{discardComments:{removeAll:!e},reduceInitial:false,normalizeWhitespace:!e,...n}]})];if(t.enabled!==false){r.push(o.forgePluginPostcssPixel(t))}return{plugins:r}};const N=(e,t={})=>{const n={hints:e?false:"warning"};return Object.assign(n,t)};const W=(e={})=>({parallel:true,
2
+ "use strict";var e=require("@flatjs/common");var t=require("lodash");var n=require("@flatjs/mock");var r=require("babel-merge");var s=require("path");var o=require("@flatjs/forge-plugin-postcss-pixel");var i=require("cssnano");var a=require("webpack");var l=require("mini-css-extract-plugin");var c=require("chalk");var p=require("image-minimizer-webpack-plugin");var u=require("terser-webpack-plugin");var d=require("@pmmmwh/react-refresh-webpack-plugin");var m=require("case-sensitive-paths-webpack-plugin");var f=require("fork-ts-checker-webpack-plugin");var v=require("webpack-bundle-analyzer");var h=require("webpack-sources");var g=require("webpack/lib/util/extractUrlAndGlobal");var b=require("html-webpack-plugin");var y=require("webpack-dev-server");var w=require("express");var j=require("https");var C=require("fs");var k=require("better-opn");function S(e){let t;const n=process.env.NODE_ENV==="FLATJS_CORE";switch(e){case"@flatjs/evolve-preset-babel":t=require.resolve(n?"../../../evolve-preset-babel/src/index":e);break}return t}const P=(e,t=false)=>{if(!t){return require(e)}else{return n.loadModule(e)}};const O=(t={usePreset:"react"},n=[])=>{const{usePreset:s,...o}=t;const i=n.map((e=>[require.resolve("babel-plugin-import"),{transformToDefaultImport:false,libraryDirectory:"cjs",style:()=>false,...e},e.libraryName]));const{reactBabelPreset:a,infernoBabelPreset:l,vueBabelPreset:c}=P(S("@flatjs/evolve-preset-babel"));const p=s==="react"?a():s==="vue"?c():l();let u={};try{u=r(p,o);if(u.plugins){u.plugins.unshift(...i)}else{u.plugins=i}}catch(t){e.printError(t)}return Object.assign({babelrc:false},u)};const x=[`https://polyfill.io/v3/polyfill.min.js?features=Array.from%2CArray.isArray%2CArray.of%2CArray.prototype.entries%2CArray.prototype.every%2CArray.prototype.fill%2CArray.prototype.filter%2CArray.prototype.find%2CArray.prototype.findIndex%2CArray.prototype.flat%2CArray.prototype.forEach%2CArray.prototype.flatMap%2CArray.prototype.keys%2CArray.prototype.indexOf%2CArray.prototype.includes%2CArray.prototype.lastIndexOf%2CArray.prototype.map%2CArray.prototype.reduce%2CArray.prototype.reduceRight%2CArray.prototype.some%2CArray.prototype.sort%2CArray.prototype.values%2CArrayBuffer%2CBlob%2CDataView%2CDate.now%2CObject.assign%2CObject.create%2CObject.defineProperties%2CObject.defineProperty%2CObject.entries%2CObject.freeze%2CObject.fromEntries%2CObject.getOwnPropertySymbols%2CObject.getOwnPropertyNames%2CObject.getOwnPropertyDescriptors%2CObject.getOwnPropertyDescriptor%2CObject.getPrototypeOf%2CObject.is%2CObject.isExtensible%2CObject.isFrozen%2CObject.isSealed%2CObject.keys%2CObject.values%2CObject.setPrototypeOf%2CPromise%2CPromise.prototype.finally%2CReflect%2CReflect.apply%2CReflect.construct%2CReflect.defineProperty%2CReflect.deleteProperty%2CReflect.getPrototypeOf%2CReflect.getOwnPropertyDescriptor%2CReflect.get%2CReflect.ownKeys%2CReflect.isExtensible%2CReflect.has%2CReflect.preventExtensions%2CReflect.set%2CReflect.setPrototypeOf%2CSet%2CString.prototype.trimStart%2CString.prototype.trimEnd%2CString.prototype.trim%2CString.prototype.startsWith%2CString.prototype.repeat%2CString.prototype.replaceAll%2CString.prototype.padStart%2CString.prototype.padEnd%2CMap%2CObject.seal%2Cconsole.groupEnd%2Cconsole.group`];const A={reactDev:[`https://unpkg.com/react@18.2.0/umd/react.development.js`,`https://unpkg.com/react-dom@18.2.0/umd/react-dom.development.js`],reactProd:[`https://unpkg.com/react@18.2.0/umd/react.production.min.js`,`https://unpkg.com/react-dom@18.2.0/umd/react-dom.production.min.js`]};const B={reactDev:[`https://cdn.jsdelivr.net/npm/react@18.2.0/umd/react.development.js`,`https://cdn.jsdelivr.net/npm/react-dom@18.2.0/umd/react-dom.development.js`],reactProd:[`https://cdn.jsdelivr.net/npm/react@18.2.0/umd/react.production.min.js`,`https://cdn.jsdelivr.net/npm/react-dom@18.2.0/umd/react-dom.production.min.js`]};const E={reactDev:[`https://cdn.bootcdn.net/ajax/libs/react/18.2.0/umd/react.development.js`,`https://cdn.bootcdn.net/ajax/libs/react-dom/18.2.0/umd/react-dom.development.js`],reactProd:[`https://cdn.bootcdn.net/ajax/libs/react/18.2.0/umd/react.production.min.js`,`https://cdn.bootcdn.net/ajax/libs/react-dom/18.2.0/umd/react-dom.production.min.js`]};const $={flatjsEvolve:{projectCwd:process.cwd(),projectVirtualPath:"flatjs/evolve",forBuild:{rejectWarnings:false},forServe:{pageMiddlewares:[],defaultServeGlobalData:()=>({})},target:["web","es5"],liveReload:false,minimizeTerserOptions:{},multiHtmlCdn:{},multiHtmlCdnResolver:()=>undefined,watchOptions:{poll:1e3,ignored:/node_modules/,aggregateTimeout:500},extraPlugins:()=>[],pluginLoaderOptions:{babelOptions:{usePreset:"react"},lessOptions:{},cssnanoOptions:{},pixelOptions:{enabled:true,rootValue:{px:100,rpx:1},outputUnit:"rem"},enableBundleHashName:true,modularImports:[]}}};const M=(e,n={},r)=>{var s,o,i;const a=r[1];const l={vue:"Vue",react:"React","react-dom":"ReactDOM"};const c=t.isFunction(n)?n(e):n;const p=t.isFunction((s=a.options)==null?void 0:s.externals)?(o=a.options)==null?void 0:o.externals(e):(i=a.options)==null?void 0:i.externals;return Object.assign({},l,c,p||{})};const q=`(function(d){var j;var b=1;var i=1;var h=750;var c=100;function e(s,o){var q=d.document;var l=q.documentElement;var k=navigator.userAgent;var m=k.toLowerCase().indexOf("android")>-1;i=d.devicePixelRatio||1;if(i>3){i=3}if(m){i=1}console.log("current devicePixelRatio:",i);l.setAttribute("data-dpr",i.toString());var p=q.querySelector('meta[name="viewport"]');if(!p){b=1/i;p=q.createElement("meta");p.setAttribute("name","viewport");q.head.appendChild(p);p.setAttribute(["content","width=device-width,user-scalable=no,initial-scale=",b,",maximum-scale=",b,",minimum-scale=",b].join(""))}function n(){var t=document.documentElement.clientWidth;j=t/o*(s/i)*i;q.documentElement.style.fontSize=String(j)+"px"}var r;d.addEventListener("resize",function(){clearTimeout(r);r=setTimeout(n,300)},false);d.addEventListener("onload",n,false);n()}e(c,h);window.fabricViewport={currRem:j,currDpr:i,currScale:b,dpiPX2px:function f(k){return parseFloat(k.toString())/j*100+"px"},px2DPIpx:function a(k){return parseFloat(k.toString())/100*j+"px"},px2rem:function g(k){return parseFloat(k.toString())/100+"rem"}}})(window);`;const R={title:"",favicon:"",inlineScripts:()=>[],headBeforeStyles:()=>[],headBeforeScripts:e=>[...x,...e==="development"?E.reactDev:E.reactProd],bodyAfterScripts:()=>[],viewport:q,excludeCdnEnvs:["me","dev","ntv"],minify:true,template:s.join(e.getPackageDirSync(__dirname,""),"templates/html-plugin/index-{0}.html")};const F=(e,n,r)=>{let s;if(r){s=typeof r==="function"?r(n):r}if(t.isUndefined(s)){const t=R[e];return typeof t==="function"?t(n):t}return s};const D=(e,t)=>Object.assign({sourceMap:e,javascriptEnabled:true},t);const T=(e,t={},n={})=>{const r=[i({preset:["default",{discardComments:{removeAll:!e},reduceInitial:false,normalizeWhitespace:!e,...n}]})];if(t.enabled!==false){r.push(o.forgePluginPostcssPixel(t))}return{plugins:r}};const N=(e,t={})=>{const n={hints:e?false:"warning"};return Object.assign(n,t)};const W=(e={})=>({parallel:true,
3
3
  // Disable Extract all or some (use /^\**!|@preserve|@license|@cc_on/i RegExp) comments.
4
- extractComments:false,terserOptions:t.merge({ecma:undefined,parse:{},compress:{},mangle:true,module:false,output:null,toplevel:false,nameCache:null,ie8:false,keep_classnames:undefined,keep_fnames:false,safari10:false},e)});const z=(n=process.cwd(),r)=>{const s=e.loadFlatjsConfig(n,"flatjsEvolve","flatjs.evolve.js");return t.merge({},$.flatjsEvolve,s.flatjsEvolve,r,{projectCwd:n})};const L=e=>{try{k(e)}catch(e){console.warn(`Unable to open browser. If you are running in a headless environment\n`)}};function U(e="",t=""){return e.replace(/\/$/,"")+"/"+t.replace(/^\//,"")}function H(e){const t=new RegExp("[?&]env(=([^&#]*)|&|#|$)");const n=t.exec(window.location.href);const r=n&&n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):"prod";const s=e[r]||e["prod"]||[];const o=s[Math.floor(Math.random()*s.length)];return o.replace(/\/$/,"")+"/"}function I(e={},t="prod"){const n=e[t]||e["prod"]||[];return n[Math.floor(Math.random()*n.length)]}function J(e){return`window.evolveFetchMicroWidgets = function () {\n var cdnConfig = ${JSON.stringify(e)};\n var cdnFinder = ${H.toString()};\n return (cdnFinder(cdnConfig) || '').replace(/\\/$/, '');\n }`}function V(e,n){const r=[];for(const[t,n]of Object.entries(e)){r.push({[t]:n.entry})}return r.map((e=>t.merge({},n,{name:Object.keys(e)[0],entry:e})))}const _=(e,n)=>{var r,s;const o=t.merge({},n.pluginLoaderOptions);if(typeof((r=e.options)==null?void 0:r.allowPx2rem)!=="undefined"){t.set(o,"pixelOptions.enabled",e.options.allowPx2rem)}if(typeof((s=e.options)==null?void 0:s.enableBundleHashName)!=="undefined"){t.set(o,"enableBundleHashName",e.options.enableBundleHashName)}const i={...n,pluginLoaderOptions:o};return i};const G=(e,t)=>{var n,r;const s=(n=e.pluginLoaderOptions)==null?void 0:(r=n.pixelOptions)==null?void 0:r.enabled;const o=(t==null?void 0:t.allowPx2rem)??s;return!!o};const K=e=>{if(Object.keys(e).length>1){throw new Error(`Only single one entry map support now while "serve", "build" process!`)}let t=undefined;for(const[n,r]of Object.entries(e)){t=[n,r];break}if(!t){throw new Error(`No entry map found while "serve", "build" process!`)}return t};const X=()=>Date.now().toString();const Y=(e,t,n=true)=>{const r=e==="js"?".js":".css";if(t){return`bundle${r}`}if(n){return`bundle[contenthash]${r}`}return`bundle${r}?${X()}`};const Q=/svg-icons\//;const Z=/\.(jpe?g|png|gif|svg)$/;const ee=/\.(ttf|eot|woff|woff2)(\?.+)?$/;const te=e=>Q.test(e)&&e.endsWith(".svg");const ne=({projectCwd:e,projectVirtualPath:t},n,[r,o])=>{let i=s.dirname(s.join(t,n.replace(/^src/,"")));const a=o.entry.map((t=>s.dirname(s.join(e,t))));const l=s.resolve(e,n);const c=a.find((e=>l.startsWith(e)));if(c){i=s.dirname(s.join(r,s.relative(c,l)))}return`${i}/[name]-[contenthash:8][ext]`};const re=(e,t)=>{const n={test(e){return ee.test(e)||Z.test(e)&&!te(e)},type:"asset",generator:{filename({filename:n}){return ne(e,n,t)}},parser:{dataUrlCondition:{maxSize:4*1024}}};return n};const se=()=>{const e={test(e){return te(e)},use:[{loader:require.resolve("./loader-icon"),options:{svgo:{plugins:[{name:"removeTitle"},{name:"removeDimensions"}]}}}]};return e};function oe(e,n){const r=t.isFunction(e)?e(n):e;if(r.usePreset==="react"&&n){if(r.plugins){r.plugins.push(require.resolve("react-refresh/babel"))}else{r.plugins=[require.resolve("react-refresh/babel")]}}return r}const ie=(e,n={})=>{const{babelOptions:r={},modularImports:s=[]}=n;const o=oe(r,e);const i=t.isFunction(s)?s(e):s;const a=O(o,i);const l={test:/\.(tsx|ts|js|jsx)$/,use:[{loader:require.resolve("babel-loader"),options:a}]};return l};const ae=(e,t={})=>{const n={test:/\.css$/i,use:[{loader:l.loader,options:{esModule:true}},{loader:"css-loader",options:{sourceMap:e}}]};const{pixelOptions:r,cssnanoOptions:s}=t;if(Array.isArray(n.use)){n.use.push({loader:"postcss-loader",options:{postcssOptions:T(e,r,s),sourceMap:e}})}return n};const le=(e,t={})=>{const n=ae(e,t);n.test=/\.less$/i;const r=t.lessOptions;if(Array.isArray(n.use)){n.use.push({loader:require.resolve("less-loader"),options:{sourceMap:e,lessOptions:R(e,r)}})}return n};const ce=(e,t,n,r={})=>{const s=[se(),re(t,n),ae(e,r),le(e,r),ie(e,r)];return s};const pe=new Map;const ue=()=>{const t=[["svgo",{}],["gifsicle",{}],["jpegtran",{}],["pngquant",{}]];const n=t.map((t=>{const n=t[0];try{require.resolve(`imagemin-${n}`);return t}catch(t){if(!pe.get(n)){pe.set(n,true);const t=c.magenta(`"${e.hasYarn()?"yarn add":"npm install"} imagemin-${n} -D"`);e.Logger.warn(`Execute ${t} for assets optimization`,"@flatjs/evolve")}return null}})).filter(Boolean);if(n.length){return new p({minimizer:{implementation:p.imageminMinify,options:{plugins:n}}})}return null};const de=e=>new u(W(e.minimizeTerserOptions));const me=(e,t)=>{if(e){return[]}return[de(t),ue()].filter(Boolean)};class fe{constructor(e={}){this.verbose=void 0;this.cleanStaleWebpackAssets=void 0;this.protectWebpackAssets=void 0;this.cleanAfterEveryBuildPatterns=void 0;this.cleanOnceBeforeBuildPatterns=void 0;this.currentAssets=void 0;this.initialClean=void 0;this.outputPath=void 0;this.verbose=e.verbose===true||false;this.cleanStaleWebpackAssets=e.cleanStaleWebpackAssets===true||e.cleanStaleWebpackAssets===false?e.cleanStaleWebpackAssets:true;this.protectWebpackAssets=e.protectWebpackAssets===true||e.protectWebpackAssets===false?e.protectWebpackAssets:true;this.cleanAfterEveryBuildPatterns=Array.isArray(e.cleanAfterEveryBuildPatterns)?e.cleanAfterEveryBuildPatterns:[];this.cleanOnceBeforeBuildPatterns=Array.isArray(e.cleanOnceBeforeBuildPatterns)?e.cleanOnceBeforeBuildPatterns:["**/*"];this.currentAssets=[];this.initialClean=false;this.outputPath="";this.apply=this.apply.bind(this);this.handleInitial=this.handleInitial.bind(this);this.handleDone=this.handleDone.bind(this);this.removeFiles=this.removeFiles.bind(this)}apply(e){if(!e.options.output||!e.options.output.path){console.warn("clean-webpack-plugin: options.output.path not defined. Plugin disabled...");return}this.outputPath=e.options.output.path;const t=e.hooks;if(this.cleanOnceBeforeBuildPatterns.length!==0){t.emit.tap("clean-webpack-plugin",(e=>{this.handleInitial(e)}))}t.done.tap("clean-webpack-plugin",(e=>{this.handleDone(e)}))}handleInitial(e){if(this.initialClean){return}const t=e.getStats();if(t.hasErrors()){return}this.initialClean=true;this.removeFiles(this.cleanOnceBeforeBuildPatterns)}handleDone(e){if(e.hasErrors()){if(this.verbose){console.warn("clean-webpack-plugin: pausing due to webpack errors")}return}const t=e.toJson({assets:true}).assets||[];const n=t.map((e=>e.name));const r=this.currentAssets.filter((e=>{const t=n.includes(e)===false;return t}));this.currentAssets=n.sort();const s=[];if(this.cleanStaleWebpackAssets===true&&r.length!==0){s.push(...r)}if(this.cleanAfterEveryBuildPatterns.length!==0){s.push(...this.cleanAfterEveryBuildPatterns)}if(s.length!==0){this.removeFiles(s)}}removeFiles(t){try{const n=e.delFilesSync(t,{cwd:this.outputPath,dot:true,ignore:this.protectWebpackAssets?this.currentAssets:[]});if(this.verbose){n.forEach((e=>{const t=s.relative(process.cwd(),e);const n="removed";console.warn(`clean-webpack-plugin: ${n} ${t}`)}))}}catch(e){const t=/Cannot delete files\/folders outside the current working directory\./.test(e.message);if(t){const e="clean-webpack-plugin: Cannot delete files/folders outside the current working directory. Can be overridden with the `dangerouslyAllowCleanPatternsOutsideProject` option.";throw new Error(e)}throw e}}}const he=t=>new fe({verbose:true,cleanOnceBeforeBuildPatterns:[`${s.join(e.ensureSlash(t[0],true),"**/*")}`]});const ve=(e,t)=>new l({filename:`[name]/${Y("css",e,t==null?void 0:t.enableBundleHashName)}`,chunkFilename:"[id].[contenthash].css"});const ge="ExternalTemplateRemotesPlugin";const be=e=>e.constructor.name==="ExternalModule";class ye{apply(e){e.hooks.make.tap(ge,(e=>{const t=[];e.hooks.buildModule.tap(ge,(e=>{if(be(e)&&e.externalType==="script"){t.push(e)}}));e.hooks.afterCodeGeneration.tap(ge,(()=>{t.map((t=>{const n=g(t.request)[0];const r=we(n);const s=e.codeGenerationResults.get(t,undefined).sources;const o=s.get("javascript");if(o){const e=new v.RawSource(o.source().toString().replace(`"${n}"`,r));s.set("javascript",e)}}))}))}))}}function we(e){const t=[];const n=[];let r=false;let s=false;for(const o of e){if(o==="["){if(r){s=true;break}r=true;if(n.length){t.push(`"${n.join("")}"`);n.length=0}}else if(o==="]"){if(!r){s=true;break}r=false;if(n.length){t.push(`${n.join("")}`);n.length=0}n.length=0}else{n.push(o)}}if(r||s){throw new Error(`Invalid template URL "${e}"`)}if(n.length){t.push(`"${n.join("")}"`)}return t.join(" + ")}const je=`HtmlInjectScriptPlugin`;class Ce{constructor(e){this.scripts=void 0;this.scripts=e||[]}processScripts(){return this.scripts.filter(Boolean).map((e=>({tagName:"script",innerHTML:e,voidTag:false,attributes:{},meta:{plugin:"html-inject-script-webpack-plugin"}})))}apply(e){e.hooks.compilation.tap(`${je}_compilation`,(e=>{const t=b.getHooks(e);t.alterAssetTags.tap(`${je}_alterAssetTags`,(e=>{e.assetTags.scripts.unshift(...this.processScripts());return e}))}))}}const ke=(e="")=>e.replace(/[\/-]/gi,"_").toLowerCase();const Se=e=>s.join(e,`micro-remote-module.js`);const Pe=(t,[n,r],s)=>{var o;const i=(o=r.options)==null?void 0:o.moduleFederation;const l=[];if(i){const{remotes:r,...o}=i;const c=Se(n);const p=ke(n);const u=(r||[]).map((({name:t,endpoint:n})=>{const r=ke(t);const s=Se(t);const o=n?e.ensureSlash(n(t),false):`[window.evolveFetchMicroWidgets()]`;return{[r]:`${r}@${o}/${s}`}}));l.push(new a.container.ModuleFederationPlugin({name:p,filename:c,remotes:u,...o}),new ye);if(!t){l.unshift(new Ce([J(s)]))}}return l};const Oe={minifyJS:true,removeComments:true,collapseWhitespace:true,collapseBooleanAttributes:false};const xe=(e,t,[n,r],s)=>{const o=[];const{options:i}=r;const a=e?"development":"production";for(const e of s){o.push(new b({inject:"body",title:D("title",a,i==null?void 0:i.title),chunks:[n],minify:(i==null?void 0:i.minify)===false?false:["me","dev"].includes(e)?false:Oe,filename:`${n}/index${e==="prod"?"":`-${e}`}.html`,template:D("template",a,i==null?void 0:i.template).replace(`{0}`,e),templateParameters:{title:D("title",a,i==null?void 0:i.title),favicon:D("favicon",a,i==null?void 0:i.favicon),inlineScripts:D("inlineScripts",a,i==null?void 0:i.inlineScripts),headBeforeStyles:D("headBeforeStyles",a,i==null?void 0:i.headBeforeStyles),headBeforeScripts:D("headBeforeScripts",a,i==null?void 0:i.headBeforeScripts),bodyAfterScripts:D("bodyAfterScripts",a,i==null?void 0:i.bodyAfterScripts),viewport:G(t,i)?D("viewport",a,i==null?void 0:i.viewport):""},multiCdn:{env:e,disabled:((i==null?void 0:i.excludeCdnEnvs)||["me","dev","ntv"]).includes(e)}}))}return o};class Ae{constructor(e){var t;this.config=e;this.pluginName="FlatEvolveMultiCdnPlugin";this.requireFn=a.RuntimeGlobals.publicPath;if(!((t=this.config)!=null&&t.prod)){throw new Error("We must setup `prod` for each CDN config node!")}}apply(e){e.hooks.thisCompilation.tap(this.pluginName,(e=>{e.mainTemplate.hooks.requireExtensions.tap(this.pluginName,((t,n)=>{var r;const s=[];s.push("// Dynamic assets path override(`@flatjs/evolve`) plugin-multi-html-cdn`)");const o=(r=e.chunkGraph)==null?void 0:r.getTreeRuntimeRequirements(n);if(o&&o.has(a.RuntimeGlobals.requireScope)){s.push("(function () {");s.push(a.Template.indent(`var flatjsMultiCdn = {`));s.push(a.Template.indent(a.Template.indent([`cdnConfig: ${JSON.stringify(this.config||{})},`])));s.push(a.Template.indent(a.Template.indent([`cdnFinder: ${H.toString()}`])));s.push(a.Template.indent(`};`));s.push(a.Template.indent(`${this.requireFn} = flatjsMultiCdn.cdnFinder(flatjsMultiCdn.cdnConfig) || ${this.requireFn};`));s.push("})();")}return a.Template.asString(s)}))}));e.hooks.compilation.tap(this.pluginName,(e=>{b.getHooks(e).beforeAssetTagGeneration.tap(this.pluginName,(e=>{const{assets:t}=e;const{userOptions:n}=e.plugin;const r=n.multiCdn;const o=t.publicPath;const i=t.js.map((e=>{if(r.disabled){return s.basename(e)}const t=I(this.config,r.env);return U(t,e.replace(o,""))}));const a=t.css.map((e=>{if(r.disabled){return s.basename(e)}const t=I(this.config,r.env);return U(t,e.replace(o,""))}));e.assets.js=i;e.assets.css=a;return e}))}))}}const Be=(e,t,n)=>{var r;const s=[new m];if(n.analyzer){s.push(new h.BundleAnalyzerPlugin({analyzerPort:"auto",analyzerMode:"server",...n.analyzer}))}s.push(new f({async:e}));s.push(ve(e,n.pluginLoaderOptions));s.push(...Pe(e,t,n.multiHtmlCdn));if(!e){s.push(he(t));const r=Object.keys(n.multiHtmlCdn);s.push(...xe(e,n,t,r));s.push(new Ae(n.multiHtmlCdn))}const o=oe(((r=n.pluginLoaderOptions)==null?void 0:r.babelOptions)||{},e);if(o.usePreset==="react"&&e){s.push(new d({overlay:false}))}return s};const Ee=(n,r,o,i)=>{process.env.NODE_ENV=n;r=r==="auto"?"auto":e.ensureSlash(r,true);const a=n==="development";const l=i.projectCwd;const c=i.pluginLoaderOptions;const p=i.watchOptions;const u=K(o);const d=t.isFunction(i.extraLoaders)?i.extraLoaders(a):i.extraLoaders;const m=[...ce(a,i,u,c),...d||[]];const f=t.isFunction(i.extraPlugins)?i.extraPlugins(a):i.extraPlugins;const h=t.isFunction(i.resolveAlias)?i.resolveAlias(a):i.resolveAlias;const v=[...Be(a,u,i),...f||[]];const g={mode:n,target:i.target,stats:{preset:"minimal"},infrastructureLogging:{level:"warn"},devtool:a?"eval-source-map":i.productionSourceMap||false,plugins:v,watchOptions:p,context:l,cache:{type:"memory"},resolve:{mainFields:["browser","module","main"],extensions:[".ts",".tsx",".js",".json",".vue"],alias:h||{}},module:{rules:m},externals:M(a,i.externals,u),performance:N(a,i.performance),output:{devtoolModuleFilenameTemplate:({namespace:e,resourcePath:t})=>`webpack:///${s.join(e,t)}`,environment:{},pathinfo:false,path:s.join(l,"public"),publicPath:r,filename:`[name]/${Y("js",a,c==null?void 0:c.enableBundleHashName)}`,chunkFilename:`[id].[contenthash].js`},optimization:{nodeEnv:a?"development":"production",chunkIds:a?"named":"named",moduleIds:a?"named":"named",minimize:i.minimize===false?false:a?false:true,minimizer:me(a,i),splitChunks:{name:false,chunks:"all",minSize:25e5,cacheGroups:{default:false,defaultVendors:false}}}};return g};const $e=(e,t,n)=>{const r=Ee("production",t,e,n);const s=V(e,r);if(s.length>1){throw new Error("startSingleEntryBuild() only support `compiler` at a time")}const o=s[0];return new Promise(((e,t)=>{a(o,((r,s)=>{var i,a;if(r){return t(r)}const l=s==null?void 0:s.toJson();if(l!=null&&(i=l.errors)!=null&&i.length){return t(l.errors)}if(n.forBuild.rejectWarnings&&l!=null&&(a=l.warnings)!=null&&a.length){return t(l.warnings)}e({name:o.name,warningStats:l==null?void 0:l.warnings})}))}))};const Me=async(t,n)=>{var r;await e.keepPackageDepsUpToDateForNonMonoRepo({cwd:process.cwd(),autoUpgrade:true,needVerifyPackages:n.needVerifyPackages||{}});const s=((r=n.multiHtmlCdn)==null?void 0:r.prod)||[];const o=[];const i=e.ensureSlash(s[Math.floor(Math.random()*s.length)],true);for(const[e,r]of Object.entries(t)){var a;const t=_(r,n);const s={[e]:r};const l=(a=r.options)==null?void 0:a.useRelativeAssetPath;o.push($e(s,l?"auto":i,t))}return Promise.all(o)};const qe=async(n,r,o)=>{const i=await e.getPackageDir(__dirname,process.cwd());const a=C.readFileSync(s.join(i,"./templates/main.html"),"utf-8");const l=[];for(const[t,s]of Object.entries(o.entryMap)){var c;const i=((c=s.options)==null?void 0:c.servePageMainLinkFn)||(e=>e);const a=Object.keys(n).includes(t);const p=o.projectVirtualPath.replace(/^\//,"");l.push({name:t.replace(p,"").replace(/^\//,""),link:i(e.urlJoin(r,["pages",t],{env:"me"}),{hostUri:r,entryName:t,virtualPath:p}),flagText:a?"serve":"static",isServed:a?1:0})}const p={title:"@flatjs/evolve",modules:l.sort(((e,t)=>t.isServed-e.isServed))};return t.template(a)(p)};const Fe=async(n,r,o,i,a,l)=>{const c=l.entryMap;const p=Object.keys(c).sort(((e,t)=>t.length-e.length));const u=await e.getPackageDir(__dirname,process.cwd());const d=p.find((t=>e.ensureSlash(o.path.replace(/^\//,""),true).startsWith(e.ensureSlash(t,true))));if(!d){const e=C.readFileSync(s.join(u,`./templates/module-404.html`),"utf-8");return t.template(e)({title:"404 Not Found",errorMeta:[{name:`@flatjs/evolve workspace`,value:u},{name:`served entry names`,value:JSON.stringify(p)},{name:`module path`,value:`${o.path}`}]})}const m=c[d];const f=m.options;const h=n[d];const v=(h==null?void 0:h.devServerHostUri)||i;const g=(f==null?void 0:f.serveModuleTemplate)||"./templates/module.html";const b=s.join(l.projectCwd,"./templates/module.html");const y=C.readFileSync(s.isAbsolute(g)?g:e.existsSync(b)?b:s.join(u,"./templates/module.html"),"utf-8");const w=l.forServe;const j=w.defaultServeGlobalData?w.defaultServeGlobalData(m,i):{};const k={title:D("title",r,f==null?void 0:f.title),favicon:D("favicon",r,f==null?void 0:f.favicon),viewport:G(l,f)?D("viewport",r,f==null?void 0:f.viewport):"",inlineScripts:D("inlineScripts",r,f==null?void 0:f.inlineScripts),headBeforeStyles:D("headBeforeStyles",r,f==null?void 0:f.headBeforeStyles),headBeforeScripts:D("headBeforeScripts",r,f==null?void 0:f.headBeforeScripts),bodyAfterScripts:D("bodyAfterScripts",r,f==null?void 0:f.bodyAfterScripts),moduleFederationScripts:J({me:[e.urlJoin(i,["public"])]}),global:{hostUrl:i,apiBase:e.urlJoin(i,[a]),routeBaseName:s.join(`/pages`,d),moduleName:d.replace(l.projectVirtualPath,"").replace(/^\//,""),...j,...(f==null?void 0:f.serveGlobalData)||{}},styles:[e.urlJoin(v,[s.join("public",d,"bundle.css")])],scripts:[e.urlJoin(v,[s.join("public",d,"bundle.js")])]};return t.template(y)(k)};const De=(e,t,n,r,s)=>{const o=async(o,i)=>{let a;if(o.path==="/"){a=await qe(r,t,s)}else{a=await Fe(r,e,o,t,n,s)}i.send(a)};return(s.forServe.pageMiddlewares||[]).concat(o)};const Re=t=>async(n,r)=>{const o=n.baseUrl;if(!o.startsWith("/public")){r.redirect("/pages")}else{const n=await e.fileWalk(s.join("public/","**/*.{js,css}"),{cwd:t});const i=s.extname(o);const a=n.find((e=>s.extname(e)===i&&e.indexOf(o.replace(/\.(js|css)$/,""))!==-1));if(a){r.sendFile(a)}else{r.sendFile(s.join(t,o))}}};const Te=(e,t="development",r,s,o,i,a)=>{const l=w();n.attachMockMiddlewares(l,a);l.set("hostUri",s);l.use("/pages",...De(t,s,a.apiContext||"api",o,i));l.use("*",Re(e));return new Promise((e=>{const t=i.https?j.createServer(i.https,l):l;t.listen(r,(()=>{e(true)}))}))};const Ne=(e,t,n)=>{const{projectCwd:r,https:o,liveReload:i}=n;const a=new y({server:{type:o?"https":"http",options:{...o}},open:false,compress:true,port:t,hot:!i,liveReload:i,allowedHosts:"all",static:{directory:`${s.join(r,"/public")}`},headers:{"Access-Control-Allow-Origin":"*"},client:{progress:true,overlay:{errors:true,warnings:false}}},e);return new Promise(((e,t)=>{a.startCallback((n=>{if(n){return t(n)}e(true)}))}))};const We=async(r,o,i,l)=>{await e.keepPackageDepsUpToDateForNonMonoRepo({cwd:process.cwd(),autoUpgrade:true,needVerifyPackages:i.needVerifyPackages||{}});if(i.https){l.https=i.https}const{mockPort:p,hostUri:u}=await n.prepareMockDomain(l);const d=e.urlJoin(u,["/pages"]);let m=p;const f=[];const h={};for(const[e]of Object.entries(o)){m=m+1;const{mockPort:r,hostUri:s}=await n.prepareMockDomain(t.merge({},l,{port:m}));h[e]={devServerPort:r,devServerHostUri:s}}for(const[t,n]of Object.entries(o)){var v,g;const o=((v=n.options)==null?void 0:(g=v.moduleFederation)==null?void 0:g.remotes)||[];o.forEach((t=>{t.endpoint=t=>{var n;return e.urlJoin(((n=h[t])==null?void 0:n.devServerHostUri)||u,["/public"])}}));const{devServerPort:l,devServerHostUri:p}=h[t];const m=e.urlJoin(p,["public"]);const b={[t]:n};const y=_(n,i);const w=Ee("development",m,b,y);const j=a.webpack(V(b,w)[0]);f.push(Ne(j,l,i));const C=c.bgBlack(`[${c.magenta("@flatjs")}:${c.bold(j.name||"")}]`);j.hooks.invalid.tap("fileChange",(e=>{console.log(C,`${"file change".padEnd(12," ")} ➩ ${c.cyan(s.relative(r,e||""))}`)}));j.hooks.done.tap("compileDone",(()=>{console.log(C,`${"serve page".padEnd(12," ")} ➩ ${c.cyan(d)}`)}))}await Te(r,"development",p,u,h,i,l);L(d);return Promise.all(f).then((()=>true)).catch((e=>{console.log("evolve serve err: ",e);return false}))};const ze=async(t,r,s)=>{if(r.https){s.https=r.https}const{mockPort:o,hostUri:i}=await n.prepareMockDomain(s);const a=e.urlJoin(i,["/pages"]);return Te(t,"development",o,i,{},r,s).then((e=>{const t=c.bgBlack(`[${c.magenta("@flatjs")}:`);console.log(t,`${"serve page".padEnd(12," ")} ➩ ${c.cyan(a)}`);return e}))};const Le=(e={},n={})=>{const r={};for(const[s,o]of Object.entries(n)){const n={options:{}};if(e[s]){r[s]=t.merge({},n,o,e[s])}t.merge(o,n)}return r};const Ue=(e,t,n={})=>{const r=z(e,n);const s=Le(t,r.entryMap);return Me(s,r)};const He=(e,t,r={},s={})=>{const o=z(e,r);const i=n.loadMockConfiguration(e,s);const a=Le(t,o.entryMap);return We(e,a,o,i)};const Ie=(e,t={},r={})=>{const s=z(e,t);const o=n.loadMockConfiguration(e,r);return ze(e,s,o)};exports.cdnBoot=E;exports.cdnJsDelivr=B;exports.cdnUnpkg=A;exports.createPageMiddleware=De;exports.createPublicAssetsMiddleware=Re;exports.defaultFlatjsConfig=$;exports.evolveBuild=Ue;exports.evolveServe=He;exports.evolveStatic=Ie;exports.flatBabelOptions=O;exports.flatExternalOptions=M;exports.flatLessLoaderOptions=R;exports.flatPerformanceOptions=N;exports.flatPostcssLoaderOptions=T;exports.getHtmlPluginConfig=D;exports.loadEvolveConfiguration=z;exports.loadModule=P;exports.normalizeEntries=Le;exports.polyfill=x;exports.terserOptions=W;exports.viewportScripts=q;
4
+ extractComments:false,terserOptions:t.merge({ecma:undefined,parse:{},compress:{},mangle:true,module:false,output:null,toplevel:false,nameCache:null,ie8:false,keep_classnames:undefined,keep_fnames:false,safari10:false},e)});const H=(n=process.cwd(),r)=>{const s=e.loadFlatjsConfig(n,"flatjsEvolve","flatjs.evolve.js");return t.merge({},$.flatjsEvolve,s.flatjsEvolve,r,{projectCwd:n})};const z=e=>{try{k(e)}catch(e){console.warn(`Unable to open browser. If you are running in a headless environment\n`)}};function L(e="",t=""){return e.replace(/\/$/,"")+"/"+t.replace(/^\//,"")}function U(e,t){const n=new RegExp("[?&]env(=([^&#]*)|&|#|$)");const r=window.location.href;const s=n.exec(r);let o=s&&s[2]?decodeURIComponent(s[2].replace(/\+/g," ")):"prod";o=t(r)||o;const i=e[o]||e["prod"]||[];const a=i[Math.floor(Math.random()*i.length)];return a.replace(/\/$/,"")+"/"}function I(e={},t="prod"){const n=e[t]||e["prod"]||[];return n[Math.floor(Math.random()*n.length)]}function J(e,t=(()=>undefined)){return`window.evolveFetchMicroWidgets = function () {\n var cdnConfig = ${JSON.stringify(e)};\n var cdnResolver = ${t.toString()};\n var cdnFinder = ${U.toString()};\n return (cdnFinder(cdnConfig, cdnResolver) || '').replace(/\\/$/, '');\n }`}function V(e,n){const r=[];for(const[t,n]of Object.entries(e)){r.push({[t]:n.entry})}return r.map((e=>t.merge({},n,{name:Object.keys(e)[0],entry:e})))}const _=(e,n)=>{var r,s;const o=t.merge({},n.pluginLoaderOptions);if(typeof((r=e.options)==null?void 0:r.allowPx2rem)!=="undefined"){t.set(o,"pixelOptions.enabled",e.options.allowPx2rem)}if(typeof((s=e.options)==null?void 0:s.enableBundleHashName)!=="undefined"){t.set(o,"enableBundleHashName",e.options.enableBundleHashName)}const i={...n,pluginLoaderOptions:o};return i};const G=(e,t)=>{var n,r;const s=(n=e.pluginLoaderOptions)==null?void 0:(r=n.pixelOptions)==null?void 0:r.enabled;const o=(t==null?void 0:t.allowPx2rem)??s;return!!o};const K=e=>{if(Object.keys(e).length>1){throw new Error(`Only single one entry map support now while "serve", "build" process!`)}let t=undefined;for(const[n,r]of Object.entries(e)){t=[n,r];break}if(!t){throw new Error(`No entry map found while "serve", "build" process!`)}return t};const X=()=>Date.now().toString();const Y=(e,t,n=true)=>{const r=e==="js"?".js":".css";if(t){return`bundle${r}`}if(n){return`bundle[contenthash]${r}`}return`bundle${r}?${X()}`};const Q=/svg-icons\//;const Z=/\.(jpe?g|png|gif|svg)$/;const ee=/\.(ttf|eot|woff|woff2)(\?.+)?$/;const te=e=>Q.test(e)&&e.endsWith(".svg");const ne=({projectCwd:e,projectVirtualPath:t},n,[r,o])=>{let i=s.dirname(s.join(t,n.replace(/^src/,"")));const a=o.entry.map((t=>s.dirname(s.join(e,t))));const l=s.resolve(e,n);const c=a.find((e=>l.startsWith(e)));if(c){i=s.dirname(s.join(r,s.relative(c,l)))}return`${i}/[name]-[contenthash:8][ext]`};const re=(e,t)=>{const n={test(e){return ee.test(e)||Z.test(e)&&!te(e)},type:"asset",generator:{filename({filename:n}){return ne(e,n,t)}},parser:{dataUrlCondition:{maxSize:4*1024}}};return n};const se=()=>{const e={test(e){return te(e)},use:[{loader:require.resolve("./loader-icon"),options:{svgo:{plugins:[{name:"removeTitle"},{name:"removeDimensions"}]}}}]};return e};function oe(e,n){const r=t.isFunction(e)?e(n):e;if(r.usePreset==="react"&&n){if(r.plugins){r.plugins.push(require.resolve("react-refresh/babel"))}else{r.plugins=[require.resolve("react-refresh/babel")]}}return r}const ie=(e,n={})=>{const{babelOptions:r={},modularImports:s=[]}=n;const o=oe(r,e);const i=t.isFunction(s)?s(e):s;const a=O(o,i);const l={test:/\.(tsx|ts|js|jsx)$/,use:[{loader:require.resolve("babel-loader"),options:a}]};return l};const ae=(e,t={})=>{const n={test:/\.css$/i,use:[{loader:l.loader,options:{esModule:true}},{loader:"css-loader",options:{sourceMap:e}}]};const{pixelOptions:r,cssnanoOptions:s}=t;if(Array.isArray(n.use)){n.use.push({loader:"postcss-loader",options:{postcssOptions:T(e,r,s),sourceMap:e}})}return n};const le=(e,t={})=>{const n=ae(e,t);n.test=/\.less$/i;const r=t.lessOptions;if(Array.isArray(n.use)){n.use.push({loader:require.resolve("less-loader"),options:{sourceMap:e,lessOptions:D(e,r)}})}return n};const ce=(e,t,n,r={})=>{const s=[se(),re(t,n),ae(e,r),le(e,r),ie(e,r)];return s};const pe=new Map;const ue=()=>{const t=[["svgo",{}],["gifsicle",{}],["jpegtran",{}],["pngquant",{}]];const n=t.map((t=>{const n=t[0];try{require.resolve(`imagemin-${n}`);return t}catch(t){if(!pe.get(n)){pe.set(n,true);const t=c.magenta(`"${e.hasYarn()?"yarn add":"npm install"} imagemin-${n} -D"`);e.Logger.warn(`Execute ${t} for assets optimization`,"@flatjs/evolve")}return null}})).filter(Boolean);if(n.length){return new p({minimizer:{implementation:p.imageminMinify,options:{plugins:n}}})}return null};const de=e=>new u(W(e.minimizeTerserOptions));const me=(e,t)=>{if(e){return[]}return[de(t),ue()].filter(Boolean)};class fe{constructor(e={}){this.verbose=void 0;this.cleanStaleWebpackAssets=void 0;this.protectWebpackAssets=void 0;this.cleanAfterEveryBuildPatterns=void 0;this.cleanOnceBeforeBuildPatterns=void 0;this.currentAssets=void 0;this.initialClean=void 0;this.outputPath=void 0;this.verbose=e.verbose===true||false;this.cleanStaleWebpackAssets=e.cleanStaleWebpackAssets===true||e.cleanStaleWebpackAssets===false?e.cleanStaleWebpackAssets:true;this.protectWebpackAssets=e.protectWebpackAssets===true||e.protectWebpackAssets===false?e.protectWebpackAssets:true;this.cleanAfterEveryBuildPatterns=Array.isArray(e.cleanAfterEveryBuildPatterns)?e.cleanAfterEveryBuildPatterns:[];this.cleanOnceBeforeBuildPatterns=Array.isArray(e.cleanOnceBeforeBuildPatterns)?e.cleanOnceBeforeBuildPatterns:["**/*"];this.currentAssets=[];this.initialClean=false;this.outputPath="";this.apply=this.apply.bind(this);this.handleInitial=this.handleInitial.bind(this);this.handleDone=this.handleDone.bind(this);this.removeFiles=this.removeFiles.bind(this)}apply(e){if(!e.options.output||!e.options.output.path){console.warn("clean-webpack-plugin: options.output.path not defined. Plugin disabled...");return}this.outputPath=e.options.output.path;const t=e.hooks;if(this.cleanOnceBeforeBuildPatterns.length!==0){t.emit.tap("clean-webpack-plugin",(e=>{this.handleInitial(e)}))}t.done.tap("clean-webpack-plugin",(e=>{this.handleDone(e)}))}handleInitial(e){if(this.initialClean){return}const t=e.getStats();if(t.hasErrors()){return}this.initialClean=true;this.removeFiles(this.cleanOnceBeforeBuildPatterns)}handleDone(e){if(e.hasErrors()){if(this.verbose){console.warn("clean-webpack-plugin: pausing due to webpack errors")}return}const t=e.toJson({assets:true}).assets||[];const n=t.map((e=>e.name));const r=this.currentAssets.filter((e=>{const t=n.includes(e)===false;return t}));this.currentAssets=n.sort();const s=[];if(this.cleanStaleWebpackAssets===true&&r.length!==0){s.push(...r)}if(this.cleanAfterEveryBuildPatterns.length!==0){s.push(...this.cleanAfterEveryBuildPatterns)}if(s.length!==0){this.removeFiles(s)}}removeFiles(t){try{const n=e.delFilesSync(t,{cwd:this.outputPath,dot:true,ignore:this.protectWebpackAssets?this.currentAssets:[]});if(this.verbose){n.forEach((e=>{const t=s.relative(process.cwd(),e);const n="removed";console.warn(`clean-webpack-plugin: ${n} ${t}`)}))}}catch(e){const t=/Cannot delete files\/folders outside the current working directory\./.test(e.message);if(t){const e="clean-webpack-plugin: Cannot delete files/folders outside the current working directory. Can be overridden with the `dangerouslyAllowCleanPatternsOutsideProject` option.";throw new Error(e)}throw e}}}const ve=t=>new fe({verbose:true,cleanOnceBeforeBuildPatterns:[`${s.join(e.ensureSlash(t[0],true),"**/*")}`]});const he=(e,t)=>new l({filename:`[name]/${Y("css",e,t==null?void 0:t.enableBundleHashName)}`,chunkFilename:"[id].[contenthash].css"});const ge="ExternalTemplateRemotesPlugin";const be=e=>e.constructor.name==="ExternalModule";class ye{apply(e){e.hooks.make.tap(ge,(e=>{const t=[];e.hooks.buildModule.tap(ge,(e=>{if(be(e)&&e.externalType==="script"){t.push(e)}}));e.hooks.afterCodeGeneration.tap(ge,(()=>{t.map((t=>{const n=g(t.request)[0];const r=we(n);const s=e.codeGenerationResults.get(t,undefined).sources;const o=s.get("javascript");if(o){const e=new h.RawSource(o.source().toString().replace(`"${n}"`,r));s.set("javascript",e)}}))}))}))}}function we(e){const t=[];const n=[];let r=false;let s=false;for(const o of e){if(o==="["){if(r){s=true;break}r=true;if(n.length){t.push(`"${n.join("")}"`);n.length=0}}else if(o==="]"){if(!r){s=true;break}r=false;if(n.length){t.push(`${n.join("")}`);n.length=0}n.length=0}else{n.push(o)}}if(r||s){throw new Error(`Invalid template URL "${e}"`)}if(n.length){t.push(`"${n.join("")}"`)}return t.join(" + ")}const je=`HtmlInjectScriptPlugin`;class Ce{constructor(e){this.scripts=void 0;this.scripts=e||[]}processScripts(){return this.scripts.filter(Boolean).map((e=>({tagName:"script",innerHTML:e,voidTag:false,attributes:{},meta:{plugin:"html-inject-script-webpack-plugin"}})))}apply(e){e.hooks.compilation.tap(`${je}_compilation`,(e=>{const t=b.getHooks(e);t.alterAssetTags.tap(`${je}_alterAssetTags`,(e=>{e.assetTags.scripts.unshift(...this.processScripts());return e}))}))}}const ke=(e="")=>e.replace(/[\/-]/gi,"_").toLowerCase();const Se=e=>s.join(e,`micro-remote-module.js`);const Pe=(t,[n,r],s)=>{var o;const i=s.multiHtmlCdn;const l=s.multiHtmlCdnResolver;const c=(o=r.options)==null?void 0:o.moduleFederation;const p=[];if(c){const{remotes:r,...s}=c;const o=Se(n);const u=ke(n);const d=(r||[]).map((({name:t,endpoint:n})=>{const r=ke(t);const s=Se(t);const o=n?e.ensureSlash(n(t),false):`[window.evolveFetchMicroWidgets()]`;return{[r]:`${r}@${o}/${s}`}}));p.push(new a.container.ModuleFederationPlugin({name:u,filename:o,remotes:d,...s}),new ye);if(!t){p.unshift(new Ce([J(i,l)]))}}return p};const Oe={minifyJS:true,removeComments:true,collapseWhitespace:true,collapseBooleanAttributes:false};const xe=(e,t,[n,r],s)=>{const o=[];const{options:i}=r;const a=e?"development":"production";for(const e of s){o.push(new b({inject:"body",title:F("title",a,i==null?void 0:i.title),chunks:[n],minify:(i==null?void 0:i.minify)===false?false:["me","dev"].includes(e)?false:Oe,filename:`${n}/index${e==="prod"?"":`-${e}`}.html`,template:F("template",a,i==null?void 0:i.template).replace(`{0}`,e),templateParameters:{title:F("title",a,i==null?void 0:i.title),favicon:F("favicon",a,i==null?void 0:i.favicon),inlineScripts:F("inlineScripts",a,i==null?void 0:i.inlineScripts),headBeforeStyles:F("headBeforeStyles",a,i==null?void 0:i.headBeforeStyles),headBeforeScripts:F("headBeforeScripts",a,i==null?void 0:i.headBeforeScripts),bodyAfterScripts:F("bodyAfterScripts",a,i==null?void 0:i.bodyAfterScripts),viewport:G(t,i)?F("viewport",a,i==null?void 0:i.viewport):""},multiCdn:{env:e,disabled:((i==null?void 0:i.excludeCdnEnvs)||["me","dev","ntv"]).includes(e)}}))}return o};class Ae{constructor(e){var t;this.pluginName="FlatEvolveMultiCdnPlugin";this.requireFn=a.RuntimeGlobals.publicPath;this.config=void 0;this.cdnResolver=void 0;this.config=e.multiHtmlCdn;this.cdnResolver=e.multiHtmlCdnResolver||(()=>undefined);if(!((t=this.config)!=null&&t.prod)){throw new Error("We must setup `prod` for each CDN config node!")}}apply(e){e.hooks.thisCompilation.tap(this.pluginName,(e=>{e.mainTemplate.hooks.requireExtensions.tap(this.pluginName,((t,n)=>{var r;const s=[];s.push("// Dynamic assets path override(`@flatjs/evolve`) plugin-multi-html-cdn`)");const o=(r=e.chunkGraph)==null?void 0:r.getTreeRuntimeRequirements(n);if(o&&o.has(a.RuntimeGlobals.requireScope)){s.push("(function () {");s.push(a.Template.indent(`var flatjsMultiCdn = {`));s.push(a.Template.indent(a.Template.indent([`cdnConfig: ${JSON.stringify(this.config||{})},`])));s.push(a.Template.indent(a.Template.indent([`cdnResolver: ${this.cdnResolver.toString()},`])));s.push(a.Template.indent(a.Template.indent([`cdnFinder: ${U.toString()}`])));s.push(a.Template.indent(`};`));s.push(a.Template.indent(`${this.requireFn} = flatjsMultiCdn.cdnFinder(flatjsMultiCdn.cdnConfig, flatjsMultiCdn.cdnResolver) || ${this.requireFn};`));s.push("})();")}return a.Template.asString(s)}))}));e.hooks.compilation.tap(this.pluginName,(e=>{b.getHooks(e).beforeAssetTagGeneration.tap(this.pluginName,(e=>{const{assets:t}=e;const{userOptions:n}=e.plugin;const r=n.multiCdn;const o=t.publicPath;const i=t.js.map((e=>{if(r.disabled){return s.basename(e)}const t=I(this.config,r.env);return L(t,e.replace(o,""))}));const a=t.css.map((e=>{if(r.disabled){return s.basename(e)}const t=I(this.config,r.env);return L(t,e.replace(o,""))}));e.assets.js=i;e.assets.css=a;return e}))}))}}const Be=(e,t,n)=>{var r;const s=[new m];if(n.analyzer){s.push(new v.BundleAnalyzerPlugin({analyzerPort:"auto",analyzerMode:"server",...n.analyzer}))}s.push(new f({async:e}));s.push(he(e,n.pluginLoaderOptions));s.push(...Pe(e,t,n));if(!e){s.push(ve(t));const r=Object.keys(n.multiHtmlCdn);s.push(...xe(e,n,t,r));s.push(new Ae(n))}const o=oe(((r=n.pluginLoaderOptions)==null?void 0:r.babelOptions)||{},e);if(o.usePreset==="react"&&e){s.push(new d({overlay:false}))}return s};const Ee=(n,r,o,i)=>{process.env.NODE_ENV=n;r=r==="auto"?"auto":e.ensureSlash(r,true);const a=n==="development";const l=i.projectCwd;const c=i.pluginLoaderOptions;const p=i.watchOptions;const u=K(o);const d=t.isFunction(i.extraLoaders)?i.extraLoaders(a):i.extraLoaders;const m=[...ce(a,i,u,c),...d||[]];const f=t.isFunction(i.extraPlugins)?i.extraPlugins(a):i.extraPlugins;const v=t.isFunction(i.resolveAlias)?i.resolveAlias(a):i.resolveAlias;const h=[...Be(a,u,i),...f||[]];const g={mode:n,target:i.target,stats:{preset:"minimal"},infrastructureLogging:{level:"warn"},devtool:a?"eval-source-map":i.productionSourceMap||false,plugins:h,watchOptions:p,context:l,cache:{type:"memory"},resolve:{mainFields:["browser","module","main"],extensions:[".ts",".tsx",".js",".json",".vue"],alias:v||{}},module:{rules:m},externals:M(a,i.externals,u),performance:N(a,i.performance),output:{devtoolModuleFilenameTemplate:({namespace:e,resourcePath:t})=>`webpack:///${s.join(e,t)}`,environment:{},pathinfo:false,path:s.join(l,"public"),publicPath:r,filename:`[name]/${Y("js",a,c==null?void 0:c.enableBundleHashName)}`,chunkFilename:`[id].[contenthash].js`},optimization:{nodeEnv:a?"development":"production",chunkIds:a?"named":"named",moduleIds:a?"named":"named",minimize:i.minimize===false?false:a?false:true,minimizer:me(a,i),splitChunks:{name:false,chunks:"all",minSize:25e5,cacheGroups:{default:false,defaultVendors:false}}}};return g};const $e=(e,t,n)=>{const r=Ee("production",t,e,n);const s=V(e,r);if(s.length>1){throw new Error("startSingleEntryBuild() only support `compiler` at a time")}const o=s[0];return new Promise(((e,t)=>{a(o,((r,s)=>{var i,a;if(r){return t(r)}const l=s==null?void 0:s.toJson();if(l!=null&&(i=l.errors)!=null&&i.length){return t(l.errors)}if(n.forBuild.rejectWarnings&&l!=null&&(a=l.warnings)!=null&&a.length){return t(l.warnings)}e({name:o.name,warningStats:l==null?void 0:l.warnings})}))}))};const Me=async(t,n)=>{var r;await e.keepPackageDepsUpToDateForNonMonoRepo({cwd:process.cwd(),autoUpgrade:true,needVerifyPackages:n.needVerifyPackages||{}});const s=((r=n.multiHtmlCdn)==null?void 0:r.prod)||[];const o=[];const i=e.ensureSlash(s[Math.floor(Math.random()*s.length)],true);for(const[e,r]of Object.entries(t)){var a;const t=_(r,n);const s={[e]:r};const l=(a=r.options)==null?void 0:a.useRelativeAssetPath;o.push($e(s,l?"auto":i,t))}return Promise.all(o)};const qe=async(n,r,o)=>{const i=await e.getPackageDir(__dirname,process.cwd());const a=C.readFileSync(s.join(i,"./templates/main.html"),"utf-8");const l=[];for(const[t,s]of Object.entries(o.entryMap)){var c;const i=((c=s.options)==null?void 0:c.servePageMainLinkFn)||(e=>e);const a=Object.keys(n).includes(t);const p=o.projectVirtualPath.replace(/^\//,"");l.push({name:t.replace(p,"").replace(/^\//,""),link:i(e.urlJoin(r,["pages",t],{env:"me"}),{hostUri:r,entryName:t,virtualPath:p}),flagText:a?"serve":"static",isServed:a?1:0})}const p={title:"@flatjs/evolve",modules:l.sort(((e,t)=>t.isServed-e.isServed))};return t.template(a)(p)};const Re=async(n,r,o,i,a,l)=>{const c=l.entryMap;const p=Object.keys(c).sort(((e,t)=>t.length-e.length));const u=await e.getPackageDir(__dirname,process.cwd());const d=p.find((t=>e.ensureSlash(o.path.replace(/^\//,""),true).startsWith(e.ensureSlash(t,true))));if(!d){const e=C.readFileSync(s.join(u,`./templates/module-404.html`),"utf-8");return t.template(e)({title:"404 Not Found",errorMeta:[{name:`@flatjs/evolve workspace`,value:u},{name:`served entry names`,value:JSON.stringify(p)},{name:`module path`,value:`${o.path}`}]})}const m=c[d];const f=m.options;const v=n[d];const h=(v==null?void 0:v.devServerHostUri)||i;const g=(f==null?void 0:f.serveModuleTemplate)||"./templates/module.html";const b=s.join(l.projectCwd,"./templates/module.html");const y=C.readFileSync(s.isAbsolute(g)?g:e.existsSync(b)?b:s.join(u,"./templates/module.html"),"utf-8");const w=l.forServe;const j=w.defaultServeGlobalData?w.defaultServeGlobalData(m,i):{};const k={title:F("title",r,f==null?void 0:f.title),favicon:F("favicon",r,f==null?void 0:f.favicon),viewport:G(l,f)?F("viewport",r,f==null?void 0:f.viewport):"",inlineScripts:F("inlineScripts",r,f==null?void 0:f.inlineScripts),headBeforeStyles:F("headBeforeStyles",r,f==null?void 0:f.headBeforeStyles),headBeforeScripts:F("headBeforeScripts",r,f==null?void 0:f.headBeforeScripts),bodyAfterScripts:F("bodyAfterScripts",r,f==null?void 0:f.bodyAfterScripts),moduleFederationScripts:J({me:[e.urlJoin(i,["public"])]},l.multiHtmlCdnResolver),global:{hostUrl:i,apiBase:e.urlJoin(i,[a]),routeBaseName:s.join(`/pages`,d),moduleName:d.replace(l.projectVirtualPath,"").replace(/^\//,""),...j,...(f==null?void 0:f.serveGlobalData)||{}},styles:[e.urlJoin(h,[s.join("public",d,"bundle.css")])],scripts:[e.urlJoin(h,[s.join("public",d,"bundle.js")])]};return t.template(y)(k)};const Fe=(e,t,n,r,s)=>{const o=async(o,i)=>{let a;if(o.path==="/"){a=await qe(r,t,s)}else{a=await Re(r,e,o,t,n,s)}i.send(a)};return(s.forServe.pageMiddlewares||[]).concat(o)};const De=t=>async(n,r)=>{const o=n.baseUrl;if(!o.startsWith("/public")){r.redirect("/pages")}else{const n=await e.fileWalk(s.join("public/","**/*.{js,css}"),{cwd:t});const i=s.extname(o);const a=n.find((e=>s.extname(e)===i&&e.indexOf(o.replace(/\.(js|css)$/,""))!==-1));if(a){r.sendFile(a)}else{r.sendFile(s.join(t,o))}}};const Te=(e,t="development",r,s,o,i,a)=>{const l=w();n.attachMockMiddlewares(l,a);l.set("hostUri",s);l.use("/pages",...Fe(t,s,a.apiContext||"api",o,i));l.use("*",De(e));return new Promise((e=>{const t=i.https?j.createServer(i.https,l):l;t.listen(r,(()=>{e(true)}))}))};const Ne=(e,t,n)=>{const{projectCwd:r,https:o,liveReload:i}=n;const a=new y({server:{type:o?"https":"http",options:{...o}},open:false,compress:true,port:t,hot:!i,liveReload:i,allowedHosts:"all",static:{directory:`${s.join(r,"/public")}`},headers:{"Access-Control-Allow-Origin":"*"},client:{progress:true,overlay:{errors:true,warnings:false}}},e);return new Promise(((e,t)=>{a.startCallback((n=>{if(n){return t(n)}e(true)}))}))};const We=async(r,o,i,l)=>{await e.keepPackageDepsUpToDateForNonMonoRepo({cwd:process.cwd(),autoUpgrade:true,needVerifyPackages:i.needVerifyPackages||{}});if(i.https){l.https=i.https}const{mockPort:p,hostUri:u}=await n.prepareMockDomain(l);const d=e.urlJoin(u,["/pages"]);let m=p;const f=[];const v={};for(const[e]of Object.entries(o)){m=m+1;const{mockPort:r,hostUri:s}=await n.prepareMockDomain(t.merge({},l,{port:m}));v[e]={devServerPort:r,devServerHostUri:s}}for(const[t,n]of Object.entries(o)){var h,g;const o=((h=n.options)==null?void 0:(g=h.moduleFederation)==null?void 0:g.remotes)||[];o.forEach((t=>{t.endpoint=t=>{var n;return e.urlJoin(((n=v[t])==null?void 0:n.devServerHostUri)||u,["/public"])}}));const{devServerPort:l,devServerHostUri:p}=v[t];const m=e.urlJoin(p,["public"]);const b={[t]:n};const y=_(n,i);const w=Ee("development",m,b,y);const j=a.webpack(V(b,w)[0]);f.push(Ne(j,l,i));const C=c.bgBlack(`[${c.magenta("@flatjs")}:${c.bold(j.name||"")}]`);j.hooks.invalid.tap("fileChange",(e=>{console.log(C,`${"file change".padEnd(12," ")} ➩ ${c.cyan(s.relative(r,e||""))}`)}));j.hooks.done.tap("compileDone",(()=>{console.log(C,`${"serve page".padEnd(12," ")} ➩ ${c.cyan(d)}`)}))}await Te(r,"development",p,u,v,i,l);z(d);return Promise.all(f).then((()=>true)).catch((e=>{console.log("evolve serve err: ",e);return false}))};const He=async(t,r,s)=>{if(r.https){s.https=r.https}const{mockPort:o,hostUri:i}=await n.prepareMockDomain(s);const a=e.urlJoin(i,["/pages"]);return Te(t,"development",o,i,{},r,s).then((e=>{const t=c.bgBlack(`[${c.magenta("@flatjs")}:`);console.log(t,`${"serve page".padEnd(12," ")} ➩ ${c.cyan(a)}`);return e}))};const ze=(e={},n={})=>{const r={};for(const[s,o]of Object.entries(n)){const n={options:{}};if(e[s]){r[s]=t.merge({},n,o,e[s])}t.merge(o,n)}return r};const Le=(e,t,n={})=>{const r=H(e,n);const s=ze(t,r.entryMap);return Me(s,r)};const Ue=(e,t,r={},s={})=>{const o=H(e,r);const i=n.loadMockConfiguration(e,s);const a=ze(t,o.entryMap);return We(e,a,o,i)};const Ie=(e,t={},r={})=>{const s=H(e,t);const o=n.loadMockConfiguration(e,r);return He(e,s,o)};exports.cdnBoot=E;exports.cdnJsDelivr=B;exports.cdnUnpkg=A;exports.createPageMiddleware=Fe;exports.createPublicAssetsMiddleware=De;exports.defaultFlatjsConfig=$;exports.evolveBuild=Le;exports.evolveServe=Ue;exports.evolveStatic=Ie;exports.flatBabelOptions=O;exports.flatExternalOptions=M;exports.flatLessLoaderOptions=D;exports.flatPerformanceOptions=N;exports.flatPostcssLoaderOptions=T;exports.getHtmlPluginConfig=F;exports.loadEvolveConfiguration=H;exports.loadModule=P;exports.normalizeEntries=ze;exports.polyfill=x;exports.terserOptions=W;exports.viewportScripts=q;
package/index.d.ts CHANGED
@@ -114,6 +114,10 @@ export declare type MultiCdnEnvType = "me" | "dev" | "uat" | "inte" | "inte2" |
114
114
  export type FlatMultiCDNConfig = {
115
115
  [key in MultiCdnEnvType]?: string[];
116
116
  };
117
+ /**
118
+ * Allow us customized to resolve current runtime environment.
119
+ */
120
+ export type FlatMultiCDNConfigResolver = (url: string) => MultiCdnEnvType | undefined;
117
121
  /**
118
122
  * The html plugin configuration for each entry item
119
123
  */
@@ -400,6 +404,23 @@ export interface FlatEvolveOptions extends Partial<Pick<Configuration, "performa
400
404
  * The plugin for `@flatjs/evolve-multi-html-cdn-plugin`
401
405
  */
402
406
  multiHtmlCdn: FlatMultiCDNConfig;
407
+ /**
408
+ * Allow us customized to resolve current runtime environment.
409
+ * ignore resolver if return undefined, otherwise use it to match environment.
410
+ * @example
411
+ * ```ts
412
+ * (url)=> {
413
+ * const env = /.*\.(qa|t)\.*\/.exec('//fex.qa.tcshuke.com/')[1];
414
+ * switch(env) {
415
+ * case 't':
416
+ * return 'rc'
417
+ * case 'qa':
418
+ * return 'inte'
419
+ * }
420
+ * }
421
+ * ```
422
+ */
423
+ multiHtmlCdnResolver?: FlatMultiCDNConfigResolver;
403
424
  /**
404
425
  * The regexp patterns to filter dependencies(will be verified) from package.json
405
426
  * @default []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatjs/evolve",
3
- "version": "1.5.21",
3
+ "version": "1.5.22",
4
4
  "description": "the webpack based tools `evolve` of @flatjs",
5
5
  "keywords": [
6
6
  "shared",
@@ -73,5 +73,5 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "f3e0c0b5bbac7bea1cb447b9164f69eef5dcde95"
76
+ "gitHead": "5d3dfba4e0cb12afb753c083554d5dc725fc9657"
77
77
  }