@empjs/chain 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +39 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.js +3 -3
- package/package.json +1 -2
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var L=Object.create;var _=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var q=(n,e)=>{for(var t in e)_(n,t,{get:e[t],enumerable:!0})},P=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of I(e))!U.call(n,i)&&i!==t&&_(n,i,{get:()=>e[i],enumerable:!(s=H(e,i))||s.enumerable});return n};var T=(n,e,t)=>(t=n!=null?L(D(n)):{},P(e||!n||!n.__esModule?_(t,"default",{value:n,enumerable:!0}):t,n)),V=n=>P(_({},"__esModule",{value:!0}),n);var B={};q(B,{default:()=>O});module.exports=V(B);var k=T(require("deepmerge"),1);var p=class{parent;constructor(e){this.parent=e}batch(e){return e(this),this}end(){return this.parent}};var o=class extends p{store;shorthands;constructor(e){super(e),this.store=new Map}extend(e){return this.shorthands=e,e.forEach(t=>{this[t]=s=>this.set(t,s)}),this}clear(){return this.store.clear(),this}delete(e){return this.store.delete(e),this}order(){let e=[...this.store].reduce((i,[r,l])=>(i[r]=l,i),{}),t=Object.keys(e),s=[...t];return t.forEach(i=>{if(!e[i])return;let{__before:r,__after:l}=e[i];r&&s.includes(r)?(s.splice(s.indexOf(i),1),s.splice(s.indexOf(r),0,i)):l&&s.includes(l)&&(s.splice(s.indexOf(i),1),s.splice(s.indexOf(l)+1,0,i))}),{entries:e,order:s}}entries(){let{entries:e,order:t}=this.order();if(t.length)return e}values(){let{entries:e,order:t}=this.order();return t.map(s=>e[s])}get(e){return this.store.get(e)}getOrCompute(e,t){return this.has(e)||this.set(e,t()),this.get(e)}has(e){return this.store.has(e)}set(e,t){return this.store.set(e,t),this}merge(e,t=[]){return Object.keys(e).forEach(s=>{if(t.includes(s))return;let i=e[s];!Array.isArray(i)&&typeof i!="object"||i===null||!this.has(s)?this.set(s,i):this.set(s,(0,k.default)(this.get(s),i))}),this}clean(e){return Object.keys(e).reduce((t,s)=>{let i=e[s];return i===void 0||Array.isArray(i)&&!i.length||Object.prototype.toString.call(i)==="[object Object]"&&!Object.keys(i).length||(t[s]=i),t},{})}when(e,t=Function.prototype,s=Function.prototype){return e?t(this):s(this),this}};var a=class extends p{store;constructor(e){super(e),this.store=new Set}add(e){return this.store.add(e),this}prepend(e){return this.store=new Set([e,...this.store]),this}clear(){return this.store.clear(),this}delete(e){return this.store.delete(e),this}values(){return[...this.store]}has(e){return this.store.has(e)}merge(e){return this.store=new Set([...this.store,...e]),this}when(e,t=Function.prototype,s=Function.prototype){return e?t(this):s(this),this}};var m=class extends o{allowedHosts;constructor(e){super(e),this.allowedHosts=new a(this),this.extend(["after","before","bonjour","clientLogLevel","color","compress","contentBase","disableHostCheck","filename","headers","historyApiFallback","host","hot","hotOnly","http2","https","index","info","inline","lazy","mimeTypes","noInfo","open","openPage","overlay","pfx","pfxPassphrase","port","proxy","progress","public","publicPath","quiet","setup","socket","sockHost","sockPath","sockPort","staticOptions","stats","stdin","useLocalIp","watchContentBase","watchOptions","writeToDisk"])}toConfig(){return this.clean({allowedHosts:this.allowedHosts.values(),...this.entries()||{}})}merge(e,t=[]){return!t.includes("allowedHosts")&&"allowedHosts"in e&&this.allowedHosts.merge(e.allowedHosts),super.merge(e,["allowedHosts"])}};function d(n){return class extends n{__before;__after;before(e){if(this.__after)throw new Error(`Unable to set .before(${JSON.stringify(e)}) with existing value for .after()`);return this.__before=e,this}after(e){if(this.__before)throw new Error(`Unable to set .after(${JSON.stringify(e)}) with existing value for .before()`);return this.__after=e,this}merge(e,t=[]){return e.before&&this.before(e.before),e.after&&this.after(e.after),super.merge(e,[...t,"before","after"])}}}var F=class extends o{name;type;init;constructor(e,t,s="plugin"){super(e),this.name=t,this.type=s,this.extend(["init"]),this.init((i,r=[])=>typeof i=="function"?new i(...r):i)}use(e,t=[]){return this.set("plugin",e).set("args",t)}tap(e){if(!this.has("plugin"))throw new Error(`Cannot call .tap() on a plugin that has not yet been defined. Call ${this.type}('${this.name}').use(<Plugin>) first.`);return this.set("args",e(this.get("args")||[])),this}set(e,t){if(e==="args"&&!Array.isArray(t))throw new Error("args must be an array of arguments");return super.set(e,t)}merge(e,t=[]){return"plugin"in e&&this.set("plugin",e.plugin),"args"in e&&this.set("args",e.args),super.merge(e,[...t,"args","plugin"])}toConfig(){let e=this.get("init"),t=this.get("plugin"),s=this.get("args"),i=null;if(t===void 0)throw new Error(`Invalid ${this.type} configuration: ${this.type}('${this.name}').use(<Plugin>) was not called to specify the plugin`);typeof t=="string"&&(i=t,t=require(i));let r=t.__expression?`(${t.__expression})`:t.name,l=e(t,s);return Object.defineProperties(l,{__pluginName:{value:this.name},__pluginType:{value:this.type},__pluginArgs:{value:s},__pluginConstructorName:{value:r},__pluginPath:{value:i}}),l}},c=d(F);var h=class extends o{alias;aliasFields;descriptionFiles;extensions;mainFields;mainFiles;modules;plugins;constructor(e){super(e),this.alias=new o(this),this.aliasFields=new a(this),this.descriptionFiles=new a(this),this.extensions=new a(this),this.mainFields=new a(this),this.mainFiles=new a(this),this.modules=new a(this),this.plugins=new o(this),this.extend(["cachePredicate","cacheWithContext","concord","enforceExtension","enforceModuleExtension","symlinks","unsafeCache"])}plugin(e){return this.plugins.getOrCompute(e,()=>new c(this,e,"resolve.plugin"))}toConfig(){return this.clean(Object.assign(this.entries()||{},{alias:this.alias.entries(),aliasFields:this.aliasFields.values(),descriptionFiles:this.descriptionFiles.values(),extensions:this.extensions.values(),mainFields:this.mainFields.values(),mainFiles:this.mainFiles.values(),modules:this.modules.values(),plugins:this.plugins.values().map(e=>e.toConfig())}))}merge(e,t=[]){let s=["alias","aliasFields","descriptionFiles","extensions","mainFields","mainFiles","modules"];return!t.includes("plugin")&&"plugin"in e&&Object.keys(e.plugin).forEach(i=>this.plugin(i).merge(e.plugin[i])),s.forEach(i=>{!t.includes(i)&&i in e&&this[i].merge(e[i])}),super.merge(e,[...t,...s,"plugin"])}};var $=T(require("deepmerge"),1);var S=class extends o{name;options;loader;constructor(e,t){super(e),this.name=t,this.extend(["loader","options"])}tap(e){return this.options(e(this.get("options"))),this}merge(e,t=[]){return!t.includes("loader")&&"loader"in e&&this.loader(e.loader),!t.includes("options")&&"options"in e&&this.options((0,$.default)(this.store.get("options")||{},e.options)),super.merge(e,[...t,"loader","options"])}toConfig(){let e=this.clean(this.entries()||{});return Object.defineProperties(e,{__useName:{value:this.name},__ruleNames:{value:this.parent?.names},__ruleTypes:{value:this.parent?.ruleTypes}}),e}},A=d(S);function N(n){return Array.isArray(n)?n:[n]}var R=class n extends o{name;names;ruleType;ruleTypes;uses;include;exclude;rules;oneOfs;resolve;enforce;test;constructor(e,t,s="rule"){super(e),this.name=t,this.names=[],this.ruleType=s,this.ruleTypes=[];let i=this;for(;i instanceof n;)this.names.unshift(i.name),this.ruleTypes.unshift(i.ruleType),i=i.parent;this.uses=new o(this),this.include=new a(this),this.exclude=new a(this),this.rules=new o(this),this.oneOfs=new o(this),this.resolve=new h(this),this.extend(["enforce","issuer","parser","resource","resourceQuery","sideEffects","test","type"])}use(e){return this.uses.getOrCompute(e,()=>new A(this,e))}rule(e){return this.rules.getOrCompute(e,()=>new n(this,e,"rule"))}oneOf(e){return this.oneOfs.getOrCompute(e,()=>new n(this,e,"oneOf"))}pre(){return this.enforce("pre")}post(){return this.enforce("post")}toConfig(){let e=this.clean(Object.assign(this.entries()||{},{include:this.include.values(),exclude:this.exclude.values(),rules:this.rules.values().map(t=>t.toConfig()),oneOf:this.oneOfs.values().map(t=>t.toConfig()),use:this.uses.values().map(t=>t.toConfig()),resolve:this.resolve.toConfig()}));return Object.defineProperties(e,{__ruleNames:{value:this.names},__ruleTypes:{value:this.ruleTypes}}),e}merge(e,t=[]){return!t.includes("include")&&"include"in e&&this.include.merge(N(e.include)),!t.includes("exclude")&&"exclude"in e&&this.exclude.merge(N(e.exclude)),!t.includes("use")&&"use"in e&&Object.keys(e.use).forEach(s=>this.use(s).merge(e.use[s])),!t.includes("rules")&&"rules"in e&&Object.keys(e.rules).forEach(s=>this.rule(s).merge(e.rules[s])),!t.includes("oneOf")&&"oneOf"in e&&Object.keys(e.oneOf).forEach(s=>this.oneOf(s).merge(e.oneOf[s])),!t.includes("resolve")&&"resolve"in e&&this.resolve.merge(e.resolve),!t.includes("test")&&"test"in e&&this.test(e.test instanceof RegExp||typeof e.test=="function"?e.test:new RegExp(e.test)),super.merge(e,[...t,"include","exclude","use","rules","oneOf","resolve","test"])}},J=d(R),z=J;var y=class extends o{rules;defaultRules;constructor(e){super(e),this.rules=new o(this),this.defaultRules=new o(this),this.extend(["noParse","strictExportPresence"])}defaultRule(e){return this.defaultRules.getOrCompute(e,()=>new z(this,e,"defaultRule"))}rule(e){return this.rules.getOrCompute(e,()=>new z(this,e,"rule"))}toConfig(){return this.clean(Object.assign(this.entries()||{},{defaultRules:this.defaultRules.values().map(e=>e.toConfig()),rules:this.rules.values().map(e=>e.toConfig())}))}merge(e,t=[]){return!t.includes("rule")&&"rule"in e&&Object.keys(e.rule).forEach(s=>this.rule(s).merge(e.rule[s])),!t.includes("defaultRule")&&"defaultRule"in e&&Object.keys(e.defaultRule).forEach(s=>this.defaultRule(s).merge(e.defaultRule[s])),super.merge(e,["rule","defaultRule"])}};var x=class extends o{minimizers;constructor(e){super(e),this.minimizers=new o(this),this.extend(["concatenateModules","flagIncludedChunks","mergeDuplicateChunks","minimize","namedChunks","namedModules","nodeEnv","noEmitOnErrors","occurrenceOrder","portableRecords","providedExports","removeAvailableModules","removeEmptyChunks","runtimeChunk","sideEffects","splitChunks","usedExports"])}minimizer(e){if(Array.isArray(e))throw new Error("optimization.minimizer() no longer supports being passed an array. Either switch to the new syntax (https://github.com/neutrinojs/webpack-chain#config-optimization-minimizers-adding) or downgrade to webpack-chain 4. If using Vue this likely means a Vue plugin has not yet been updated to support Vue CLI 4+.");return this.minimizers.getOrCompute(e,()=>new c(this,e,"optimization.minimizer"))}toConfig(){return this.clean(Object.assign(this.entries()||{},{minimizer:this.minimizers.values().map(e=>e.toConfig())}))}merge(e,t=[]){return!t.includes("minimizer")&&"minimizer"in e&&Object.keys(e.minimizer).forEach(s=>this.minimizer(s).merge(e.minimizer[s])),super.merge(e,[...t,"minimizer"])}};var C=class extends o{constructor(e){super(e),this.extend(["auxiliaryComment","chunkCallbackName","chunkFilename","chunkLoadTimeout","crossOriginLoading","devtoolFallbackModuleFilenameTemplate","devtoolLineToLine","devtoolModuleFilenameTemplate","devtoolNamespace","filename","futureEmitAssets","globalObject","hashDigest","hashDigestLength","hashFunction","hashSalt","hotUpdateChunkFilename","hotUpdateFunction","hotUpdateMainFilename","jsonpFunction","library","libraryExport","libraryTarget","path","pathinfo","publicPath","sourceMapFilename","sourcePrefix","strictModuleExceptionHandling","umdNamedDefine","webassemblyModuleFilename"])}};var w=class extends o{constructor(e){super(e),this.extend(["assetFilter","hints","maxAssetSize","maxEntrypointSize"])}};var v=class extends h{moduleExtensions;packageMains;constructor(e){super(e),this.moduleExtensions=new a(this),this.packageMains=new a(this)}toConfig(){return this.clean({moduleExtensions:this.moduleExtensions.values(),packageMains:this.packageMains.values(),...super.toConfig()})}merge(e,t=[]){let s=["moduleExtensions","packageMains"];return s.forEach(i=>{!t.includes(i)&&i in e&&this[i].merge(e[i])}),super.merge(e,[...t,...s])}};var O=class n extends o{devServer;entryPoints;module;node;optimization;output;performance;plugins;resolve;resolveLoader;constructor(){super({}),this.devServer=new m(this),this.entryPoints=new o(this),this.module=new y(this),this.node=new o(this),this.optimization=new x(this),this.output=new C(this),this.performance=new w(this),this.plugins=new o(this),this.resolve=new h(this),this.resolveLoader=new v(this),this.extend(["amd","bail","cache","context","devtool","externals","loader","mode","name","parallelism","profile","recordsInputPath","recordsPath","recordsOutputPath","stats","target","watch","watchOptions"])}static toString(e,{verbose:t=!1,configPrefix:s="config"}={}){let{stringify:i}=require("javascript-stringify");return i(e,(r,l,g)=>{if(r&&r.__pluginName){let f=`/* ${s}.${r.__pluginType}('${r.__pluginName}') */
|
|
2
|
-
`,E=r.__pluginPath?`(require(${g(r.__pluginPath)}))`:r.__pluginConstructorName;if(E){let
|
|
1
|
+
"use strict";var L=Object.create;var O=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var U=(n,e)=>{for(var t in e)O(n,t,{get:e[t],enumerable:!0})},k=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of D(e))!q.call(n,i)&&i!==t&&O(n,i,{get:()=>e[i],enumerable:!(s=H(e,i))||s.enumerable});return n};var z=(n,e,t)=>(t=n!=null?L(I(n)):{},k(e||!n||!n.__esModule?O(t,"default",{value:n,enumerable:!0}):t,n)),V=n=>k(O({},"__esModule",{value:!0}),n);var W={};U(W,{default:()=>_});module.exports=V(W);var P=z(require("deepmerge"),1);var p=class{parent;constructor(e){this.parent=e}batch(e){return e(this),this}end(){return this.parent}};var o=class extends p{store;shorthands;constructor(e){super(e),this.store=new Map}extend(e){return this.shorthands=e,e.forEach(t=>{this[t]=s=>this.set(t,s)}),this}clear(){return this.store.clear(),this}delete(e){return this.store.delete(e),this}order(){let e=[...this.store].reduce((i,[r,h])=>(i[r]=h,i),{}),t=Object.keys(e),s=[...t];return t.forEach(i=>{if(!e[i])return;let{__before:r,__after:h}=e[i];r&&s.includes(r)?(s.splice(s.indexOf(i),1),s.splice(s.indexOf(r),0,i)):h&&s.includes(h)&&(s.splice(s.indexOf(i),1),s.splice(s.indexOf(h)+1,0,i))}),{entries:e,order:s}}entries(){let{entries:e,order:t}=this.order();if(t.length)return e}values(){let{entries:e,order:t}=this.order();return t.map(s=>e[s])}get(e){return this.store.get(e)}getOrCompute(e,t){return this.has(e)||this.set(e,t()),this.get(e)}has(e){return this.store.has(e)}set(e,t){return this.store.set(e,t),this}merge(e,t=[]){return Object.keys(e).forEach(s=>{if(t.includes(s))return;let i=e[s];!Array.isArray(i)&&typeof i!="object"||i===null||!this.has(s)?this.set(s,i):this.set(s,(0,P.default)(this.get(s),i))}),this}clean(e){return Object.keys(e).reduce((t,s)=>{let i=e[s];return i===void 0||Array.isArray(i)&&!i.length||Object.prototype.toString.call(i)==="[object Object]"&&!Object.keys(i).length||(t[s]=i),t},{})}when(e,t=Function.prototype,s=Function.prototype){return e?t(this):s(this),this}};var a=class extends p{store;constructor(e){super(e),this.store=new Set}add(e){return this.store.add(e),this}prepend(e){return this.store=new Set([e,...this.store]),this}clear(){return this.store.clear(),this}delete(e){return this.store.delete(e),this}values(){return[...this.store]}has(e){return this.store.has(e)}merge(e){return this.store=new Set([...this.store,...e]),this}when(e,t=Function.prototype,s=Function.prototype){return e?t(this):s(this),this}};var m=class extends o{allowedHosts;constructor(e){super(e),this.allowedHosts=new a(this),this.extend(["after","before","bonjour","clientLogLevel","color","compress","contentBase","disableHostCheck","filename","headers","historyApiFallback","host","hot","hotOnly","http2","https","index","info","inline","lazy","mimeTypes","noInfo","open","openPage","overlay","pfx","pfxPassphrase","port","proxy","progress","public","publicPath","quiet","setup","socket","sockHost","sockPath","sockPort","staticOptions","stats","stdin","useLocalIp","watchContentBase","watchOptions","writeToDisk"])}toConfig(){return this.clean({allowedHosts:this.allowedHosts.values(),...this.entries()||{}})}merge(e,t=[]){return!t.includes("allowedHosts")&&"allowedHosts"in e&&this.allowedHosts.merge(e.allowedHosts),super.merge(e,["allowedHosts"])}};function d(n){return class extends n{__before;__after;before(e){if(this.__after)throw new Error(`Unable to set .before(${JSON.stringify(e)}) with existing value for .after()`);return this.__before=e,this}after(e){if(this.__before)throw new Error(`Unable to set .after(${JSON.stringify(e)}) with existing value for .before()`);return this.__after=e,this}merge(e,t=[]){return e.before&&this.before(e.before),e.after&&this.after(e.after),super.merge(e,[...t,"before","after"])}}}var M=class extends o{name;type;init;constructor(e,t,s="plugin"){super(e),this.name=t,this.type=s,this.extend(["init"]),this.init((i,r=[])=>typeof i=="function"?new i(...r):i)}use(e,t=[]){return this.set("plugin",e).set("args",t)}tap(e){if(!this.has("plugin"))throw new Error(`Cannot call .tap() on a plugin that has not yet been defined. Call ${this.type}('${this.name}').use(<Plugin>) first.`);return this.set("args",e(this.get("args")||[])),this}set(e,t){if(e==="args"&&!Array.isArray(t))throw new Error("args must be an array of arguments");return super.set(e,t)}merge(e,t=[]){return"plugin"in e&&this.set("plugin",e.plugin),"args"in e&&this.set("args",e.args),super.merge(e,[...t,"args","plugin"])}toConfig(){let e=this.get("init"),t=this.get("plugin"),s=this.get("args"),i=null;if(t===void 0)throw new Error(`Invalid ${this.type} configuration: ${this.type}('${this.name}').use(<Plugin>) was not called to specify the plugin`);typeof t=="string"&&(i=t,t=require(i));let r=t.__expression?`(${t.__expression})`:t.name,h=e(t,s);return Object.defineProperties(h,{__pluginName:{value:this.name},__pluginType:{value:this.type},__pluginArgs:{value:s},__pluginConstructorName:{value:r},__pluginPath:{value:i}}),h}},c=d(M);var l=class extends o{alias;aliasFields;descriptionFiles;extensions;mainFields;mainFiles;modules;plugins;constructor(e){super(e),this.alias=new o(this),this.aliasFields=new a(this),this.descriptionFiles=new a(this),this.extensions=new a(this),this.mainFields=new a(this),this.mainFiles=new a(this),this.modules=new a(this),this.plugins=new o(this)}cachePredicate(e){return this.set("cachePredicate",e)}cacheWithContext(e){return this.set("cacheWithContext",e)}concord(e){return this.set("concord",e)}enforceExtension(e){return this.set("enforceExtension",e)}enforceModuleExtension(e){return this.set("enforceModuleExtension",e)}symlinks(e){return this.set("symlinks",e)}unsafeCache(e){return this.set("unsafeCache",e)}plugin(e){return this.plugins.getOrCompute(e,()=>new c(this,e,"resolve.plugin"))}toConfig(){return this.clean(Object.assign(this.entries()||{},{alias:this.alias.entries(),aliasFields:this.aliasFields.values(),descriptionFiles:this.descriptionFiles.values(),extensions:this.extensions.values(),mainFields:this.mainFields.values(),mainFiles:this.mainFiles.values(),modules:this.modules.values(),plugins:this.plugins.values().map(e=>e.toConfig())}))}merge(e,t=[]){let s=["alias","aliasFields","descriptionFiles","extensions","mainFields","mainFiles","modules"];return!t.includes("plugin")&&"plugin"in e&&Object.keys(e.plugin).forEach(i=>this.plugin(i).merge(e.plugin[i])),s.forEach(i=>{!t.includes(i)&&i in e&&this[i].merge(e[i])}),super.merge(e,[...t,...s,"plugin"])}};var T=z(require("deepmerge"),1);var R=class extends o{name;constructor(e,t){super(e),this.name=t}loader(e){return this.set("loader",e)}options(e){return this.set("options",e)}tap(e){return this.options(e(this.get("options"))),this}merge(e,t=[]){return!t.includes("loader")&&"loader"in e&&this.loader(e.loader),!t.includes("options")&&"options"in e&&this.options((0,T.default)(this.store.get("options")||{},e.options)),super.merge(e,[...t,"loader","options"])}toConfig(){let e=this.clean(this.entries()||{});return Object.defineProperties(e,{__useName:{value:this.name},__ruleNames:{value:this.parent?.names},__ruleTypes:{value:this.parent?.ruleTypes}}),e}},A=d(R);function $(n){return Array.isArray(n)?n:[n]}var F=class n extends o{name;names;ruleType;ruleTypes;uses;include;exclude;rules;oneOfs;resolve;enforce;test;constructor(e,t,s="rule"){super(e),this.name=t,this.names=[],this.ruleType=s,this.ruleTypes=[];let i=this;for(;i instanceof n;)this.names.unshift(i.name),this.ruleTypes.unshift(i.ruleType),i=i.parent;this.uses=new o(this),this.include=new a(this),this.exclude=new a(this),this.rules=new o(this),this.oneOfs=new o(this),this.resolve=new l(this),this.extend(["enforce","issuer","parser","resource","resourceQuery","sideEffects","test","type"])}use(e){return this.uses.getOrCompute(e,()=>new A(this,e))}rule(e){return this.rules.getOrCompute(e,()=>new n(this,e,"rule"))}oneOf(e){return this.oneOfs.getOrCompute(e,()=>new n(this,e,"oneOf"))}pre(){return this.enforce("pre")}post(){return this.enforce("post")}toConfig(){let e=this.clean(Object.assign(this.entries()||{},{include:this.include.values(),exclude:this.exclude.values(),rules:this.rules.values().map(t=>t.toConfig()),oneOf:this.oneOfs.values().map(t=>t.toConfig()),use:this.uses.values().map(t=>t.toConfig()),resolve:this.resolve.toConfig()}));return Object.defineProperties(e,{__ruleNames:{value:this.names},__ruleTypes:{value:this.ruleTypes}}),e}merge(e,t=[]){return!t.includes("include")&&"include"in e&&this.include.merge($(e.include)),!t.includes("exclude")&&"exclude"in e&&this.exclude.merge($(e.exclude)),!t.includes("use")&&"use"in e&&Object.keys(e.use).forEach(s=>this.use(s).merge(e.use[s])),!t.includes("rules")&&"rules"in e&&Object.keys(e.rules).forEach(s=>this.rule(s).merge(e.rules[s])),!t.includes("oneOf")&&"oneOf"in e&&Object.keys(e.oneOf).forEach(s=>this.oneOf(s).merge(e.oneOf[s])),!t.includes("resolve")&&"resolve"in e&&this.resolve.merge(e.resolve),!t.includes("test")&&"test"in e&&this.test(e.test instanceof RegExp||typeof e.test=="function"?e.test:new RegExp(e.test)),super.merge(e,[...t,"include","exclude","use","rules","oneOf","resolve","test"])}},J=d(F),S=J;var y=class extends o{rules;defaultRules;constructor(e){super(e),this.rules=new o(this),this.defaultRules=new o(this)}noParse(e){return this.set("noParse",e)}strictExportPresence(e){return this.set("strictExportPresence",e)}defaultRule(e){return this.defaultRules.getOrCompute(e,()=>new S(this,e,"defaultRule"))}rule(e){return this.rules.getOrCompute(e,()=>new S(this,e,"rule"))}toConfig(){return this.clean(Object.assign(this.entries()||{},{defaultRules:this.defaultRules.values().map(e=>e.toConfig()),rules:this.rules.values().map(e=>e.toConfig())}))}merge(e,t=[]){return!t.includes("rule")&&"rule"in e&&Object.keys(e.rule).forEach(s=>this.rule(s).merge(e.rule[s])),!t.includes("defaultRule")&&"defaultRule"in e&&Object.keys(e.defaultRule).forEach(s=>this.defaultRule(s).merge(e.defaultRule[s])),super.merge(e,["rule","defaultRule"])}};var x=class extends o{minimizers;constructor(e){super(e),this.minimizers=new o(this),this.extend([])}splitChunks(e){return this.set("splitChunks",e)}concatenateModules(e){return this.set("concatenateModules",e)}flagIncludedChunks(e){return this.set("flagIncludedChunks",e)}mergeDuplicateChunks(e){return this.set("mergeDuplicateChunks",e)}minimize(e){return this.set("minimize",e)}namedChunks(e){return this.set("namedChunks",e)}namedModules(e){return this.set("namedModules",e)}nodeEnv(e){return this.set("nodeEnv",e)}noEmitOnErrors(e){return this.set("noEmitOnErrors",e)}occurrenceOrder(e){return this.set("occurrenceOrder",e)}portableRecords(e){return this.set("portableRecords",e)}providedExports(e){return this.set("providedExports",e)}removeAvailableModules(e){return this.set("removeAvailableModules",e)}removeEmptyChunks(e){return this.set("removeEmptyChunks",e)}runtimeChunk(e){return this.set("runtimeChunk",e)}sideEffects(e){return this.set("sideEffects",e)}usedExports(e){return this.set("usedExports",e)}minimizer(e){if(Array.isArray(e))throw new Error("optimization.minimizer() no longer supports being passed an array. Either switch to the new syntax (https://github.com/neutrinojs/webpack-chain#config-optimization-minimizers-adding) or downgrade to webpack-chain 4. If using Vue this likely means a Vue plugin has not yet been updated to support Vue CLI 4+.");return this.minimizers.getOrCompute(e,()=>new c(this,e,"optimization.minimizer"))}toConfig(){return this.clean(Object.assign(this.entries()||{},{minimizer:this.minimizers.values().map(e=>e.toConfig())}))}merge(e,t=[]){return!t.includes("minimizer")&&"minimizer"in e&&Object.keys(e.minimizer).forEach(s=>this.minimizer(s).merge(e.minimizer[s])),super.merge(e,[...t,"minimizer"])}};var C=class extends o{constructor(e){super(e),this.extend(["auxiliaryComment","chunkCallbackName","chunkFilename","chunkLoadTimeout","crossOriginLoading","devtoolFallbackModuleFilenameTemplate","devtoolLineToLine","devtoolModuleFilenameTemplate","devtoolNamespace","filename","futureEmitAssets","globalObject","hashDigest","hashDigestLength","hashFunction","hashSalt","hotUpdateChunkFilename","hotUpdateFunction","hotUpdateMainFilename","jsonpFunction","library","libraryExport","libraryTarget","path","pathinfo","publicPath","sourceMapFilename","sourcePrefix","strictModuleExceptionHandling","umdNamedDefine","webassemblyModuleFilename"])}};var w=class extends o{constructor(e){super(e)}assetFilter(e){return this.set("assetFilter",e)}hints(e){return this.set("hints",e)}maxAssetSize(e){return this.set("maxAssetSize",e)}maxEntrypointSize(e){return this.set("maxEntrypointSize",e)}};var v=class extends l{moduleExtensions;packageMains;constructor(e){super(e),this.moduleExtensions=new a(this),this.packageMains=new a(this)}toConfig(){return this.clean({moduleExtensions:this.moduleExtensions.values(),packageMains:this.packageMains.values(),...super.toConfig()})}merge(e,t=[]){let s=["moduleExtensions","packageMains"];return s.forEach(i=>{!t.includes(i)&&i in e&&this[i].merge(e[i])}),super.merge(e,[...t,...s])}};var _=class n extends o{devServer;entryPoints;module;node;optimization;output;performance;plugins;resolve;resolveLoader;constructor(){super({}),this.devServer=new m(this),this.entryPoints=new o(this),this.module=new y(this),this.node=new o(this),this.optimization=new x(this),this.output=new C(this),this.performance=new w(this),this.plugins=new o(this),this.resolve=new l(this),this.resolveLoader=new v(this),this.extend(["amd","bail","cache","context","devtool","externals","loader","mode","name","parallelism","profile","recordsInputPath","recordsPath","recordsOutputPath","stats","target","watch","watchOptions"])}static toString(e,{verbose:t=!1,configPrefix:s="config"}={}){let{stringify:i}=require("javascript-stringify");return i(e,(r,h,g)=>{if(r&&r.__pluginName){let f=`/* ${s}.${r.__pluginType}('${r.__pluginName}') */
|
|
2
|
+
`,E=r.__pluginPath?`(require(${g(r.__pluginPath)}))`:r.__pluginConstructorName;if(E){let b=g(r.__pluginArgs).slice(1,-1);return`${f}new ${E}(${b})`}return f+g(r.__pluginArgs&&r.__pluginArgs.length?{args:r.__pluginArgs}:{})}if(r&&r.__ruleNames){let f=r.__ruleTypes;return`/* ${s}.module${r.__ruleNames.map((b,N)=>`.${f?f[N]:"rule"}('${b}')`).join("")}${r.__useName?`.use('${r.__useName}')`:""} */
|
|
3
3
|
`+g(r)}return r&&r.__expression?r.__expression:typeof r=="function"&&!t&&r.toString().length>100?"function () { /* omitted long function */ }":g(r)},2)}entry(e){return this.entryPoints.getOrCompute(e,()=>new a(this))}plugin(e){return this.plugins.getOrCompute(e,()=>new c(this,e))}toConfig(){let e=this.entryPoints.entries()||{};return this.clean(Object.assign(this.entries()||{},{node:this.node.entries(),output:this.output.entries(),resolve:this.resolve.toConfig(),resolveLoader:this.resolveLoader.toConfig(),devServer:this.devServer.toConfig(),module:this.module.toConfig(),optimization:this.optimization.toConfig(),plugins:this.plugins.values().map(t=>t.toConfig()),performance:this.performance.entries(),entry:Object.keys(e).reduce((t,s)=>Object.assign(t,{[s]:e[s].values()}),{})}))}toString(e){return n.toString(this.toConfig(),e)}merge(e={},t=[]){let s=["node","output","resolve","resolveLoader","devServer","optimization","performance","module"];return!t.includes("entry")&&"entry"in e&&Object.keys(e.entry).forEach(i=>this.entry(i).merge([].concat(e.entry[i]))),!t.includes("plugin")&&"plugin"in e&&Object.keys(e.plugin).forEach(i=>this.plugin(i).merge(e.plugin[i])),s.forEach(i=>{!t.includes(i)&&i in e&&this[i].merge(e[i])}),super.merge(e,[...t,...s,"entry","plugin"])}};
|
|
4
4
|
if (module.exports.default) module.exports = module.exports.default;
|
package/dist/index.d.cts
CHANGED
|
@@ -51,6 +51,8 @@ declare class Module extends ChainedMap {
|
|
|
51
51
|
rules: ChainedMap;
|
|
52
52
|
defaultRules: ChainedMap;
|
|
53
53
|
constructor(parent: any);
|
|
54
|
+
noParse(value: RegExp | RegExp[] | ((resource: string) => boolean) | Array<(resource: string) => boolean> | string | Array<string | RegExp>): this;
|
|
55
|
+
strictExportPresence(value: boolean): this;
|
|
54
56
|
defaultRule(name: string): any;
|
|
55
57
|
rule(name: string): any;
|
|
56
58
|
toConfig(): any;
|
|
@@ -60,6 +62,32 @@ declare class Module extends ChainedMap {
|
|
|
60
62
|
declare class Optimization extends ChainedMap {
|
|
61
63
|
minimizers: ChainedMap;
|
|
62
64
|
constructor(parent: any);
|
|
65
|
+
splitChunks(value: false | {
|
|
66
|
+
chunks?: 'all' | 'async' | 'initial';
|
|
67
|
+
minSize?: number;
|
|
68
|
+
minChunks?: number;
|
|
69
|
+
automaticNameDelimiter?: string;
|
|
70
|
+
cacheGroups?: Record<string, any>;
|
|
71
|
+
[key: string]: any;
|
|
72
|
+
}): this;
|
|
73
|
+
concatenateModules(value: boolean): this;
|
|
74
|
+
flagIncludedChunks(value: boolean): this;
|
|
75
|
+
mergeDuplicateChunks(value: boolean): this;
|
|
76
|
+
minimize(value: boolean): this;
|
|
77
|
+
namedChunks(value: boolean | string): this;
|
|
78
|
+
namedModules(value: boolean | string): this;
|
|
79
|
+
nodeEnv(value: string | boolean): this;
|
|
80
|
+
noEmitOnErrors(value: boolean): this;
|
|
81
|
+
occurrenceOrder(value: boolean): this;
|
|
82
|
+
portableRecords(value: boolean): this;
|
|
83
|
+
providedExports(value: boolean): this;
|
|
84
|
+
removeAvailableModules(value: boolean): this;
|
|
85
|
+
removeEmptyChunks(value: boolean): this;
|
|
86
|
+
runtimeChunk(value: boolean | 'single' | 'multiple' | {
|
|
87
|
+
name?: string | ((entryPoint: any) => string);
|
|
88
|
+
}): this;
|
|
89
|
+
sideEffects(value: boolean): this;
|
|
90
|
+
usedExports(value: boolean | 'global'): this;
|
|
63
91
|
minimizer(name: string | any[]): any;
|
|
64
92
|
toConfig(): any;
|
|
65
93
|
merge(obj: any, omit?: string[]): this;
|
|
@@ -71,6 +99,10 @@ declare class Output extends ChainedMap {
|
|
|
71
99
|
|
|
72
100
|
declare class Performance extends ChainedMap {
|
|
73
101
|
constructor(parent: any);
|
|
102
|
+
assetFilter(value: (assetFilename: string) => boolean): this;
|
|
103
|
+
hints(value: 'warning' | 'error' | false): this;
|
|
104
|
+
maxAssetSize(value: number): this;
|
|
105
|
+
maxEntrypointSize(value: number): this;
|
|
74
106
|
}
|
|
75
107
|
|
|
76
108
|
declare class Resolve extends ChainedMap {
|
|
@@ -83,6 +115,13 @@ declare class Resolve extends ChainedMap {
|
|
|
83
115
|
modules: ChainedSet;
|
|
84
116
|
plugins: ChainedMap;
|
|
85
117
|
constructor(parent: any);
|
|
118
|
+
cachePredicate(value: (request: string, context?: Record<string, any>) => boolean): this;
|
|
119
|
+
cacheWithContext(value: boolean): this;
|
|
120
|
+
concord(value: Record<string, unknown>): this;
|
|
121
|
+
enforceExtension(value: boolean): this;
|
|
122
|
+
enforceModuleExtension(value: boolean): this;
|
|
123
|
+
symlinks(value: boolean): this;
|
|
124
|
+
unsafeCache(value: boolean | RegExp | ((request: string) => boolean)): this;
|
|
86
125
|
plugin(name: string): any;
|
|
87
126
|
toConfig(): any;
|
|
88
127
|
merge(obj: any, omit?: string[]): this;
|
package/dist/index.d.ts
CHANGED
|
@@ -51,6 +51,8 @@ declare class Module extends ChainedMap {
|
|
|
51
51
|
rules: ChainedMap;
|
|
52
52
|
defaultRules: ChainedMap;
|
|
53
53
|
constructor(parent: any);
|
|
54
|
+
noParse(value: RegExp | RegExp[] | ((resource: string) => boolean) | Array<(resource: string) => boolean> | string | Array<string | RegExp>): this;
|
|
55
|
+
strictExportPresence(value: boolean): this;
|
|
54
56
|
defaultRule(name: string): any;
|
|
55
57
|
rule(name: string): any;
|
|
56
58
|
toConfig(): any;
|
|
@@ -60,6 +62,32 @@ declare class Module extends ChainedMap {
|
|
|
60
62
|
declare class Optimization extends ChainedMap {
|
|
61
63
|
minimizers: ChainedMap;
|
|
62
64
|
constructor(parent: any);
|
|
65
|
+
splitChunks(value: false | {
|
|
66
|
+
chunks?: 'all' | 'async' | 'initial';
|
|
67
|
+
minSize?: number;
|
|
68
|
+
minChunks?: number;
|
|
69
|
+
automaticNameDelimiter?: string;
|
|
70
|
+
cacheGroups?: Record<string, any>;
|
|
71
|
+
[key: string]: any;
|
|
72
|
+
}): this;
|
|
73
|
+
concatenateModules(value: boolean): this;
|
|
74
|
+
flagIncludedChunks(value: boolean): this;
|
|
75
|
+
mergeDuplicateChunks(value: boolean): this;
|
|
76
|
+
minimize(value: boolean): this;
|
|
77
|
+
namedChunks(value: boolean | string): this;
|
|
78
|
+
namedModules(value: boolean | string): this;
|
|
79
|
+
nodeEnv(value: string | boolean): this;
|
|
80
|
+
noEmitOnErrors(value: boolean): this;
|
|
81
|
+
occurrenceOrder(value: boolean): this;
|
|
82
|
+
portableRecords(value: boolean): this;
|
|
83
|
+
providedExports(value: boolean): this;
|
|
84
|
+
removeAvailableModules(value: boolean): this;
|
|
85
|
+
removeEmptyChunks(value: boolean): this;
|
|
86
|
+
runtimeChunk(value: boolean | 'single' | 'multiple' | {
|
|
87
|
+
name?: string | ((entryPoint: any) => string);
|
|
88
|
+
}): this;
|
|
89
|
+
sideEffects(value: boolean): this;
|
|
90
|
+
usedExports(value: boolean | 'global'): this;
|
|
63
91
|
minimizer(name: string | any[]): any;
|
|
64
92
|
toConfig(): any;
|
|
65
93
|
merge(obj: any, omit?: string[]): this;
|
|
@@ -71,6 +99,10 @@ declare class Output extends ChainedMap {
|
|
|
71
99
|
|
|
72
100
|
declare class Performance extends ChainedMap {
|
|
73
101
|
constructor(parent: any);
|
|
102
|
+
assetFilter(value: (assetFilename: string) => boolean): this;
|
|
103
|
+
hints(value: 'warning' | 'error' | false): this;
|
|
104
|
+
maxAssetSize(value: number): this;
|
|
105
|
+
maxEntrypointSize(value: number): this;
|
|
74
106
|
}
|
|
75
107
|
|
|
76
108
|
declare class Resolve extends ChainedMap {
|
|
@@ -83,6 +115,13 @@ declare class Resolve extends ChainedMap {
|
|
|
83
115
|
modules: ChainedSet;
|
|
84
116
|
plugins: ChainedMap;
|
|
85
117
|
constructor(parent: any);
|
|
118
|
+
cachePredicate(value: (request: string, context?: Record<string, any>) => boolean): this;
|
|
119
|
+
cacheWithContext(value: boolean): this;
|
|
120
|
+
concord(value: Record<string, unknown>): this;
|
|
121
|
+
enforceExtension(value: boolean): this;
|
|
122
|
+
enforceModuleExtension(value: boolean): this;
|
|
123
|
+
symlinks(value: boolean): this;
|
|
124
|
+
unsafeCache(value: boolean | RegExp | ((request: string) => boolean)): this;
|
|
86
125
|
plugin(name: string): any;
|
|
87
126
|
toConfig(): any;
|
|
88
127
|
merge(obj: any, omit?: string[]): this;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
|
|
2
|
-
var M=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});import A from"deepmerge";var d=class{parent;constructor(e){this.parent=e}batch(e){return e(this),this}end(){return this.parent}};var r=class extends d{store;shorthands;constructor(e){super(e),this.store=new Map}extend(e){return this.shorthands=e,e.forEach(t=>{this[t]=s=>this.set(t,s)}),this}clear(){return this.store.clear(),this}delete(e){return this.store.delete(e),this}order(){let e=[...this.store].reduce((i,[n,h])=>(i[n]=h,i),{}),t=Object.keys(e),s=[...t];return t.forEach(i=>{if(!e[i])return;let{__before:n,__after:h}=e[i];n&&s.includes(n)?(s.splice(s.indexOf(i),1),s.splice(s.indexOf(n),0,i)):h&&s.includes(h)&&(s.splice(s.indexOf(i),1),s.splice(s.indexOf(h)+1,0,i))}),{entries:e,order:s}}entries(){let{entries:e,order:t}=this.order();if(t.length)return e}values(){let{entries:e,order:t}=this.order();return t.map(s=>e[s])}get(e){return this.store.get(e)}getOrCompute(e,t){return this.has(e)||this.set(e,t()),this.get(e)}has(e){return this.store.has(e)}set(e,t){return this.store.set(e,t),this}merge(e,t=[]){return Object.keys(e).forEach(s=>{if(t.includes(s))return;let i=e[s];!Array.isArray(i)&&typeof i!="object"||i===null||!this.has(s)?this.set(s,i):this.set(s,A(this.get(s),i))}),this}clean(e){return Object.keys(e).reduce((t,s)=>{let i=e[s];return i===void 0||Array.isArray(i)&&!i.length||Object.prototype.toString.call(i)==="[object Object]"&&!Object.keys(i).length||(t[s]=i),t},{})}when(e,t=Function.prototype,s=Function.prototype){return e?t(this):s(this),this}};var a=class extends d{store;constructor(e){super(e),this.store=new Set}add(e){return this.store.add(e),this}prepend(e){return this.store=new Set([e,...this.store]),this}clear(){return this.store.clear(),this}delete(e){return this.store.delete(e),this}values(){return[...this.store]}has(e){return this.store.has(e)}merge(e){return this.store=new Set([...this.store,...e]),this}when(e,t=Function.prototype,s=Function.prototype){return e?t(this):s(this),this}};var y=class extends r{allowedHosts;constructor(e){super(e),this.allowedHosts=new a(this),this.extend(["after","before","bonjour","clientLogLevel","color","compress","contentBase","disableHostCheck","filename","headers","historyApiFallback","host","hot","hotOnly","http2","https","index","info","inline","lazy","mimeTypes","noInfo","open","openPage","overlay","pfx","pfxPassphrase","port","proxy","progress","public","publicPath","quiet","setup","socket","sockHost","sockPath","sockPort","staticOptions","stats","stdin","useLocalIp","watchContentBase","watchOptions","writeToDisk"])}toConfig(){return this.clean({allowedHosts:this.allowedHosts.values(),...this.entries()||{}})}merge(e,t=[]){return!t.includes("allowedHosts")&&"allowedHosts"in e&&this.allowedHosts.merge(e.allowedHosts),super.merge(e,["allowedHosts"])}};function c(o){return class extends o{__before;__after;before(e){if(this.__after)throw new Error(`Unable to set .before(${JSON.stringify(e)}) with existing value for .after()`);return this.__before=e,this}after(e){if(this.__before)throw new Error(`Unable to set .after(${JSON.stringify(e)}) with existing value for .before()`);return this.__after=e,this}merge(e,t=[]){return e.before&&this.before(e.before),e.after&&this.after(e.after),super.merge(e,[...t,"before","after"])}}}var F=class extends r{name;type;init;constructor(e,t,s="plugin"){super(e),this.name=t,this.type=s,this.extend(["init"]),this.init((i,n=[])=>typeof i=="function"?new i(...n):i)}use(e,t=[]){return this.set("plugin",e).set("args",t)}tap(e){if(!this.has("plugin"))throw new Error(`Cannot call .tap() on a plugin that has not yet been defined. Call ${this.type}('${this.name}').use(<Plugin>) first.`);return this.set("args",e(this.get("args")||[])),this}set(e,t){if(e==="args"&&!Array.isArray(t))throw new Error("args must be an array of arguments");return super.set(e,t)}merge(e,t=[]){return"plugin"in e&&this.set("plugin",e.plugin),"args"in e&&this.set("args",e.args),super.merge(e,[...t,"args","plugin"])}toConfig(){let e=this.get("init"),t=this.get("plugin"),s=this.get("args"),i=null;if(t===void 0)throw new Error(`Invalid ${this.type} configuration: ${this.type}('${this.name}').use(<Plugin>) was not called to specify the plugin`);typeof t=="string"&&(i=t,t=M(i));let n=t.__expression?`(${t.__expression})`:t.name,h=e(t,s);return Object.defineProperties(h,{__pluginName:{value:this.name},__pluginType:{value:this.type},__pluginArgs:{value:s},__pluginConstructorName:{value:n},__pluginPath:{value:i}}),h}},g=c(F);var p=class extends r{alias;aliasFields;descriptionFiles;extensions;mainFields;mainFiles;modules;plugins;constructor(e){super(e),this.alias=new r(this),this.aliasFields=new a(this),this.descriptionFiles=new a(this),this.extensions=new a(this),this.mainFields=new a(this),this.mainFiles=new a(this),this.modules=new a(this),this.plugins=new r(this),this.extend(["cachePredicate","cacheWithContext","concord","enforceExtension","enforceModuleExtension","symlinks","unsafeCache"])}plugin(e){return this.plugins.getOrCompute(e,()=>new g(this,e,"resolve.plugin"))}toConfig(){return this.clean(Object.assign(this.entries()||{},{alias:this.alias.entries(),aliasFields:this.aliasFields.values(),descriptionFiles:this.descriptionFiles.values(),extensions:this.extensions.values(),mainFields:this.mainFields.values(),mainFiles:this.mainFiles.values(),modules:this.modules.values(),plugins:this.plugins.values().map(e=>e.toConfig())}))}merge(e,t=[]){let s=["alias","aliasFields","descriptionFiles","extensions","mainFields","mainFiles","modules"];return!t.includes("plugin")&&"plugin"in e&&Object.keys(e.plugin).forEach(i=>this.plugin(i).merge(e.plugin[i])),s.forEach(i=>{!t.includes(i)&&i in e&&this[i].merge(e[i])}),super.merge(e,[...t,...s,"plugin"])}};import N from"deepmerge";var S=class extends r{name;options;loader;constructor(e,t){super(e),this.name=t,this.extend(["loader","options"])}tap(e){return this.options(e(this.get("options"))),this}merge(e,t=[]){return!t.includes("loader")&&"loader"in e&&this.loader(e.loader),!t.includes("options")&&"options"in e&&this.options(N(this.store.get("options")||{},e.options)),super.merge(e,[...t,"loader","options"])}toConfig(){let e=this.clean(this.entries()||{});return Object.defineProperties(e,{__useName:{value:this.name},__ruleNames:{value:this.parent?.names},__ruleTypes:{value:this.parent?.ruleTypes}}),e}},T=c(S);function k(o){return Array.isArray(o)?o:[o]}var R=class o extends r{name;names;ruleType;ruleTypes;uses;include;exclude;rules;oneOfs;resolve;enforce;test;constructor(e,t,s="rule"){super(e),this.name=t,this.names=[],this.ruleType=s,this.ruleTypes=[];let i=this;for(;i instanceof o;)this.names.unshift(i.name),this.ruleTypes.unshift(i.ruleType),i=i.parent;this.uses=new r(this),this.include=new a(this),this.exclude=new a(this),this.rules=new r(this),this.oneOfs=new r(this),this.resolve=new p(this),this.extend(["enforce","issuer","parser","resource","resourceQuery","sideEffects","test","type"])}use(e){return this.uses.getOrCompute(e,()=>new T(this,e))}rule(e){return this.rules.getOrCompute(e,()=>new o(this,e,"rule"))}oneOf(e){return this.oneOfs.getOrCompute(e,()=>new o(this,e,"oneOf"))}pre(){return this.enforce("pre")}post(){return this.enforce("post")}toConfig(){let e=this.clean(Object.assign(this.entries()||{},{include:this.include.values(),exclude:this.exclude.values(),rules:this.rules.values().map(t=>t.toConfig()),oneOf:this.oneOfs.values().map(t=>t.toConfig()),use:this.uses.values().map(t=>t.toConfig()),resolve:this.resolve.toConfig()}));return Object.defineProperties(e,{__ruleNames:{value:this.names},__ruleTypes:{value:this.ruleTypes}}),e}merge(e,t=[]){return!t.includes("include")&&"include"in e&&this.include.merge(k(e.include)),!t.includes("exclude")&&"exclude"in e&&this.exclude.merge(k(e.exclude)),!t.includes("use")&&"use"in e&&Object.keys(e.use).forEach(s=>this.use(s).merge(e.use[s])),!t.includes("rules")&&"rules"in e&&Object.keys(e.rules).forEach(s=>this.rule(s).merge(e.rules[s])),!t.includes("oneOf")&&"oneOf"in e&&Object.keys(e.oneOf).forEach(s=>this.oneOf(s).merge(e.oneOf[s])),!t.includes("resolve")&&"resolve"in e&&this.resolve.merge(e.resolve),!t.includes("test")&&"test"in e&&this.test(e.test instanceof RegExp||typeof e.test=="function"?e.test:new RegExp(e.test)),super.merge(e,[...t,"include","exclude","use","rules","oneOf","resolve","test"])}},b=c(R),z=b;var x=class extends r{rules;defaultRules;constructor(e){super(e),this.rules=new r(this),this.defaultRules=new r(this),this.extend(["noParse","strictExportPresence"])}defaultRule(e){return this.defaultRules.getOrCompute(e,()=>new z(this,e,"defaultRule"))}rule(e){return this.rules.getOrCompute(e,()=>new z(this,e,"rule"))}toConfig(){return this.clean(Object.assign(this.entries()||{},{defaultRules:this.defaultRules.values().map(e=>e.toConfig()),rules:this.rules.values().map(e=>e.toConfig())}))}merge(e,t=[]){return!t.includes("rule")&&"rule"in e&&Object.keys(e.rule).forEach(s=>this.rule(s).merge(e.rule[s])),!t.includes("defaultRule")&&"defaultRule"in e&&Object.keys(e.defaultRule).forEach(s=>this.defaultRule(s).merge(e.defaultRule[s])),super.merge(e,["rule","defaultRule"])}};var C=class extends r{minimizers;constructor(e){super(e),this.minimizers=new r(this),this.extend(["concatenateModules","flagIncludedChunks","mergeDuplicateChunks","minimize","namedChunks","namedModules","nodeEnv","noEmitOnErrors","occurrenceOrder","portableRecords","providedExports","removeAvailableModules","removeEmptyChunks","runtimeChunk","sideEffects","splitChunks","usedExports"])}minimizer(e){if(Array.isArray(e))throw new Error("optimization.minimizer() no longer supports being passed an array. Either switch to the new syntax (https://github.com/neutrinojs/webpack-chain#config-optimization-minimizers-adding) or downgrade to webpack-chain 4. If using Vue this likely means a Vue plugin has not yet been updated to support Vue CLI 4+.");return this.minimizers.getOrCompute(e,()=>new g(this,e,"optimization.minimizer"))}toConfig(){return this.clean(Object.assign(this.entries()||{},{minimizer:this.minimizers.values().map(e=>e.toConfig())}))}merge(e,t=[]){return!t.includes("minimizer")&&"minimizer"in e&&Object.keys(e.minimizer).forEach(s=>this.minimizer(s).merge(e.minimizer[s])),super.merge(e,[...t,"minimizer"])}};var w=class extends r{constructor(e){super(e),this.extend(["auxiliaryComment","chunkCallbackName","chunkFilename","chunkLoadTimeout","crossOriginLoading","devtoolFallbackModuleFilenameTemplate","devtoolLineToLine","devtoolModuleFilenameTemplate","devtoolNamespace","filename","futureEmitAssets","globalObject","hashDigest","hashDigestLength","hashFunction","hashSalt","hotUpdateChunkFilename","hotUpdateFunction","hotUpdateMainFilename","jsonpFunction","library","libraryExport","libraryTarget","path","pathinfo","publicPath","sourceMapFilename","sourcePrefix","strictModuleExceptionHandling","umdNamedDefine","webassemblyModuleFilename"])}};var v=class extends r{constructor(e){super(e),this.extend(["assetFilter","hints","maxAssetSize","maxEntrypointSize"])}};var _=class extends p{moduleExtensions;packageMains;constructor(e){super(e),this.moduleExtensions=new a(this),this.packageMains=new a(this)}toConfig(){return this.clean({moduleExtensions:this.moduleExtensions.values(),packageMains:this.packageMains.values(),...super.toConfig()})}merge(e,t=[]){let s=["moduleExtensions","packageMains"];return s.forEach(i=>{!t.includes(i)&&i in e&&this[i].merge(e[i])}),super.merge(e,[...t,...s])}};var P=class o extends r{devServer;entryPoints;module;node;optimization;output;performance;plugins;resolve;resolveLoader;constructor(){super({}),this.devServer=new y(this),this.entryPoints=new r(this),this.module=new x(this),this.node=new r(this),this.optimization=new C(this),this.output=new w(this),this.performance=new v(this),this.plugins=new r(this),this.resolve=new p(this),this.resolveLoader=new _(this),this.extend(["amd","bail","cache","context","devtool","externals","loader","mode","name","parallelism","profile","recordsInputPath","recordsPath","recordsOutputPath","stats","target","watch","watchOptions"])}static toString(e,{verbose:t=!1,configPrefix:s="config"}={}){let{stringify:i}=M("javascript-stringify");return i(e,(n,h,f)=>{if(n&&n.__pluginName){let m=`/* ${s}.${n.__pluginType}('${n.__pluginName}') */
|
|
3
|
-
`,
|
|
4
|
-
`+f(n)}return n&&n.__expression?n.__expression:typeof n=="function"&&!t&&n.toString().length>100?"function () { /* omitted long function */ }":f(n)},2)}entry(e){return this.entryPoints.getOrCompute(e,()=>new a(this))}plugin(e){return this.plugins.getOrCompute(e,()=>new g(this,e))}toConfig(){let e=this.entryPoints.entries()||{};return this.clean(Object.assign(this.entries()||{},{node:this.node.entries(),output:this.output.entries(),resolve:this.resolve.toConfig(),resolveLoader:this.resolveLoader.toConfig(),devServer:this.devServer.toConfig(),module:this.module.toConfig(),optimization:this.optimization.toConfig(),plugins:this.plugins.values().map(t=>t.toConfig()),performance:this.performance.entries(),entry:Object.keys(e).reduce((t,s)=>Object.assign(t,{[s]:e[s].values()}),{})}))}toString(e){return o.toString(this.toConfig(),e)}merge(e={},t=[]){let s=["node","output","resolve","resolveLoader","devServer","optimization","performance","module"];return!t.includes("entry")&&"entry"in e&&Object.keys(e.entry).forEach(i=>this.entry(i).merge([].concat(e.entry[i]))),!t.includes("plugin")&&"plugin"in e&&Object.keys(e.plugin).forEach(i=>this.plugin(i).merge(e.plugin[i])),s.forEach(i=>{!t.includes(i)&&i in e&&this[i].merge(e[i])}),super.merge(e,[...t,...s,"entry","plugin"])}};export{
|
|
2
|
+
var b=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});import A from"deepmerge";var d=class{parent;constructor(e){this.parent=e}batch(e){return e(this),this}end(){return this.parent}};var r=class extends d{store;shorthands;constructor(e){super(e),this.store=new Map}extend(e){return this.shorthands=e,e.forEach(t=>{this[t]=s=>this.set(t,s)}),this}clear(){return this.store.clear(),this}delete(e){return this.store.delete(e),this}order(){let e=[...this.store].reduce((i,[n,l])=>(i[n]=l,i),{}),t=Object.keys(e),s=[...t];return t.forEach(i=>{if(!e[i])return;let{__before:n,__after:l}=e[i];n&&s.includes(n)?(s.splice(s.indexOf(i),1),s.splice(s.indexOf(n),0,i)):l&&s.includes(l)&&(s.splice(s.indexOf(i),1),s.splice(s.indexOf(l)+1,0,i))}),{entries:e,order:s}}entries(){let{entries:e,order:t}=this.order();if(t.length)return e}values(){let{entries:e,order:t}=this.order();return t.map(s=>e[s])}get(e){return this.store.get(e)}getOrCompute(e,t){return this.has(e)||this.set(e,t()),this.get(e)}has(e){return this.store.has(e)}set(e,t){return this.store.set(e,t),this}merge(e,t=[]){return Object.keys(e).forEach(s=>{if(t.includes(s))return;let i=e[s];!Array.isArray(i)&&typeof i!="object"||i===null||!this.has(s)?this.set(s,i):this.set(s,A(this.get(s),i))}),this}clean(e){return Object.keys(e).reduce((t,s)=>{let i=e[s];return i===void 0||Array.isArray(i)&&!i.length||Object.prototype.toString.call(i)==="[object Object]"&&!Object.keys(i).length||(t[s]=i),t},{})}when(e,t=Function.prototype,s=Function.prototype){return e?t(this):s(this),this}};var a=class extends d{store;constructor(e){super(e),this.store=new Set}add(e){return this.store.add(e),this}prepend(e){return this.store=new Set([e,...this.store]),this}clear(){return this.store.clear(),this}delete(e){return this.store.delete(e),this}values(){return[...this.store]}has(e){return this.store.has(e)}merge(e){return this.store=new Set([...this.store,...e]),this}when(e,t=Function.prototype,s=Function.prototype){return e?t(this):s(this),this}};var y=class extends r{allowedHosts;constructor(e){super(e),this.allowedHosts=new a(this),this.extend(["after","before","bonjour","clientLogLevel","color","compress","contentBase","disableHostCheck","filename","headers","historyApiFallback","host","hot","hotOnly","http2","https","index","info","inline","lazy","mimeTypes","noInfo","open","openPage","overlay","pfx","pfxPassphrase","port","proxy","progress","public","publicPath","quiet","setup","socket","sockHost","sockPath","sockPort","staticOptions","stats","stdin","useLocalIp","watchContentBase","watchOptions","writeToDisk"])}toConfig(){return this.clean({allowedHosts:this.allowedHosts.values(),...this.entries()||{}})}merge(e,t=[]){return!t.includes("allowedHosts")&&"allowedHosts"in e&&this.allowedHosts.merge(e.allowedHosts),super.merge(e,["allowedHosts"])}};function c(o){return class extends o{__before;__after;before(e){if(this.__after)throw new Error(`Unable to set .before(${JSON.stringify(e)}) with existing value for .after()`);return this.__before=e,this}after(e){if(this.__before)throw new Error(`Unable to set .after(${JSON.stringify(e)}) with existing value for .before()`);return this.__after=e,this}merge(e,t=[]){return e.before&&this.before(e.before),e.after&&this.after(e.after),super.merge(e,[...t,"before","after"])}}}var M=class extends r{name;type;init;constructor(e,t,s="plugin"){super(e),this.name=t,this.type=s,this.extend(["init"]),this.init((i,n=[])=>typeof i=="function"?new i(...n):i)}use(e,t=[]){return this.set("plugin",e).set("args",t)}tap(e){if(!this.has("plugin"))throw new Error(`Cannot call .tap() on a plugin that has not yet been defined. Call ${this.type}('${this.name}').use(<Plugin>) first.`);return this.set("args",e(this.get("args")||[])),this}set(e,t){if(e==="args"&&!Array.isArray(t))throw new Error("args must be an array of arguments");return super.set(e,t)}merge(e,t=[]){return"plugin"in e&&this.set("plugin",e.plugin),"args"in e&&this.set("args",e.args),super.merge(e,[...t,"args","plugin"])}toConfig(){let e=this.get("init"),t=this.get("plugin"),s=this.get("args"),i=null;if(t===void 0)throw new Error(`Invalid ${this.type} configuration: ${this.type}('${this.name}').use(<Plugin>) was not called to specify the plugin`);typeof t=="string"&&(i=t,t=b(i));let n=t.__expression?`(${t.__expression})`:t.name,l=e(t,s);return Object.defineProperties(l,{__pluginName:{value:this.name},__pluginType:{value:this.type},__pluginArgs:{value:s},__pluginConstructorName:{value:n},__pluginPath:{value:i}}),l}},g=c(M);var p=class extends r{alias;aliasFields;descriptionFiles;extensions;mainFields;mainFiles;modules;plugins;constructor(e){super(e),this.alias=new r(this),this.aliasFields=new a(this),this.descriptionFiles=new a(this),this.extensions=new a(this),this.mainFields=new a(this),this.mainFiles=new a(this),this.modules=new a(this),this.plugins=new r(this)}cachePredicate(e){return this.set("cachePredicate",e)}cacheWithContext(e){return this.set("cacheWithContext",e)}concord(e){return this.set("concord",e)}enforceExtension(e){return this.set("enforceExtension",e)}enforceModuleExtension(e){return this.set("enforceModuleExtension",e)}symlinks(e){return this.set("symlinks",e)}unsafeCache(e){return this.set("unsafeCache",e)}plugin(e){return this.plugins.getOrCompute(e,()=>new g(this,e,"resolve.plugin"))}toConfig(){return this.clean(Object.assign(this.entries()||{},{alias:this.alias.entries(),aliasFields:this.aliasFields.values(),descriptionFiles:this.descriptionFiles.values(),extensions:this.extensions.values(),mainFields:this.mainFields.values(),mainFiles:this.mainFiles.values(),modules:this.modules.values(),plugins:this.plugins.values().map(e=>e.toConfig())}))}merge(e,t=[]){let s=["alias","aliasFields","descriptionFiles","extensions","mainFields","mainFiles","modules"];return!t.includes("plugin")&&"plugin"in e&&Object.keys(e.plugin).forEach(i=>this.plugin(i).merge(e.plugin[i])),s.forEach(i=>{!t.includes(i)&&i in e&&this[i].merge(e[i])}),super.merge(e,[...t,...s,"plugin"])}};import $ from"deepmerge";var R=class extends r{name;constructor(e,t){super(e),this.name=t}loader(e){return this.set("loader",e)}options(e){return this.set("options",e)}tap(e){return this.options(e(this.get("options"))),this}merge(e,t=[]){return!t.includes("loader")&&"loader"in e&&this.loader(e.loader),!t.includes("options")&&"options"in e&&this.options($(this.store.get("options")||{},e.options)),super.merge(e,[...t,"loader","options"])}toConfig(){let e=this.clean(this.entries()||{});return Object.defineProperties(e,{__useName:{value:this.name},__ruleNames:{value:this.parent?.names},__ruleTypes:{value:this.parent?.ruleTypes}}),e}},z=c(R);function P(o){return Array.isArray(o)?o:[o]}var F=class o extends r{name;names;ruleType;ruleTypes;uses;include;exclude;rules;oneOfs;resolve;enforce;test;constructor(e,t,s="rule"){super(e),this.name=t,this.names=[],this.ruleType=s,this.ruleTypes=[];let i=this;for(;i instanceof o;)this.names.unshift(i.name),this.ruleTypes.unshift(i.ruleType),i=i.parent;this.uses=new r(this),this.include=new a(this),this.exclude=new a(this),this.rules=new r(this),this.oneOfs=new r(this),this.resolve=new p(this),this.extend(["enforce","issuer","parser","resource","resourceQuery","sideEffects","test","type"])}use(e){return this.uses.getOrCompute(e,()=>new z(this,e))}rule(e){return this.rules.getOrCompute(e,()=>new o(this,e,"rule"))}oneOf(e){return this.oneOfs.getOrCompute(e,()=>new o(this,e,"oneOf"))}pre(){return this.enforce("pre")}post(){return this.enforce("post")}toConfig(){let e=this.clean(Object.assign(this.entries()||{},{include:this.include.values(),exclude:this.exclude.values(),rules:this.rules.values().map(t=>t.toConfig()),oneOf:this.oneOfs.values().map(t=>t.toConfig()),use:this.uses.values().map(t=>t.toConfig()),resolve:this.resolve.toConfig()}));return Object.defineProperties(e,{__ruleNames:{value:this.names},__ruleTypes:{value:this.ruleTypes}}),e}merge(e,t=[]){return!t.includes("include")&&"include"in e&&this.include.merge(P(e.include)),!t.includes("exclude")&&"exclude"in e&&this.exclude.merge(P(e.exclude)),!t.includes("use")&&"use"in e&&Object.keys(e.use).forEach(s=>this.use(s).merge(e.use[s])),!t.includes("rules")&&"rules"in e&&Object.keys(e.rules).forEach(s=>this.rule(s).merge(e.rules[s])),!t.includes("oneOf")&&"oneOf"in e&&Object.keys(e.oneOf).forEach(s=>this.oneOf(s).merge(e.oneOf[s])),!t.includes("resolve")&&"resolve"in e&&this.resolve.merge(e.resolve),!t.includes("test")&&"test"in e&&this.test(e.test instanceof RegExp||typeof e.test=="function"?e.test:new RegExp(e.test)),super.merge(e,[...t,"include","exclude","use","rules","oneOf","resolve","test"])}},N=c(F),S=N;var x=class extends r{rules;defaultRules;constructor(e){super(e),this.rules=new r(this),this.defaultRules=new r(this)}noParse(e){return this.set("noParse",e)}strictExportPresence(e){return this.set("strictExportPresence",e)}defaultRule(e){return this.defaultRules.getOrCompute(e,()=>new S(this,e,"defaultRule"))}rule(e){return this.rules.getOrCompute(e,()=>new S(this,e,"rule"))}toConfig(){return this.clean(Object.assign(this.entries()||{},{defaultRules:this.defaultRules.values().map(e=>e.toConfig()),rules:this.rules.values().map(e=>e.toConfig())}))}merge(e,t=[]){return!t.includes("rule")&&"rule"in e&&Object.keys(e.rule).forEach(s=>this.rule(s).merge(e.rule[s])),!t.includes("defaultRule")&&"defaultRule"in e&&Object.keys(e.defaultRule).forEach(s=>this.defaultRule(s).merge(e.defaultRule[s])),super.merge(e,["rule","defaultRule"])}};var C=class extends r{minimizers;constructor(e){super(e),this.minimizers=new r(this),this.extend([])}splitChunks(e){return this.set("splitChunks",e)}concatenateModules(e){return this.set("concatenateModules",e)}flagIncludedChunks(e){return this.set("flagIncludedChunks",e)}mergeDuplicateChunks(e){return this.set("mergeDuplicateChunks",e)}minimize(e){return this.set("minimize",e)}namedChunks(e){return this.set("namedChunks",e)}namedModules(e){return this.set("namedModules",e)}nodeEnv(e){return this.set("nodeEnv",e)}noEmitOnErrors(e){return this.set("noEmitOnErrors",e)}occurrenceOrder(e){return this.set("occurrenceOrder",e)}portableRecords(e){return this.set("portableRecords",e)}providedExports(e){return this.set("providedExports",e)}removeAvailableModules(e){return this.set("removeAvailableModules",e)}removeEmptyChunks(e){return this.set("removeEmptyChunks",e)}runtimeChunk(e){return this.set("runtimeChunk",e)}sideEffects(e){return this.set("sideEffects",e)}usedExports(e){return this.set("usedExports",e)}minimizer(e){if(Array.isArray(e))throw new Error("optimization.minimizer() no longer supports being passed an array. Either switch to the new syntax (https://github.com/neutrinojs/webpack-chain#config-optimization-minimizers-adding) or downgrade to webpack-chain 4. If using Vue this likely means a Vue plugin has not yet been updated to support Vue CLI 4+.");return this.minimizers.getOrCompute(e,()=>new g(this,e,"optimization.minimizer"))}toConfig(){return this.clean(Object.assign(this.entries()||{},{minimizer:this.minimizers.values().map(e=>e.toConfig())}))}merge(e,t=[]){return!t.includes("minimizer")&&"minimizer"in e&&Object.keys(e.minimizer).forEach(s=>this.minimizer(s).merge(e.minimizer[s])),super.merge(e,[...t,"minimizer"])}};var w=class extends r{constructor(e){super(e),this.extend(["auxiliaryComment","chunkCallbackName","chunkFilename","chunkLoadTimeout","crossOriginLoading","devtoolFallbackModuleFilenameTemplate","devtoolLineToLine","devtoolModuleFilenameTemplate","devtoolNamespace","filename","futureEmitAssets","globalObject","hashDigest","hashDigestLength","hashFunction","hashSalt","hotUpdateChunkFilename","hotUpdateFunction","hotUpdateMainFilename","jsonpFunction","library","libraryExport","libraryTarget","path","pathinfo","publicPath","sourceMapFilename","sourcePrefix","strictModuleExceptionHandling","umdNamedDefine","webassemblyModuleFilename"])}};var v=class extends r{constructor(e){super(e)}assetFilter(e){return this.set("assetFilter",e)}hints(e){return this.set("hints",e)}maxAssetSize(e){return this.set("maxAssetSize",e)}maxEntrypointSize(e){return this.set("maxEntrypointSize",e)}};var O=class extends p{moduleExtensions;packageMains;constructor(e){super(e),this.moduleExtensions=new a(this),this.packageMains=new a(this)}toConfig(){return this.clean({moduleExtensions:this.moduleExtensions.values(),packageMains:this.packageMains.values(),...super.toConfig()})}merge(e,t=[]){let s=["moduleExtensions","packageMains"];return s.forEach(i=>{!t.includes(i)&&i in e&&this[i].merge(e[i])}),super.merge(e,[...t,...s])}};var k=class o extends r{devServer;entryPoints;module;node;optimization;output;performance;plugins;resolve;resolveLoader;constructor(){super({}),this.devServer=new y(this),this.entryPoints=new r(this),this.module=new x(this),this.node=new r(this),this.optimization=new C(this),this.output=new w(this),this.performance=new v(this),this.plugins=new r(this),this.resolve=new p(this),this.resolveLoader=new O(this),this.extend(["amd","bail","cache","context","devtool","externals","loader","mode","name","parallelism","profile","recordsInputPath","recordsPath","recordsOutputPath","stats","target","watch","watchOptions"])}static toString(e,{verbose:t=!1,configPrefix:s="config"}={}){let{stringify:i}=b("javascript-stringify");return i(e,(n,l,f)=>{if(n&&n.__pluginName){let m=`/* ${s}.${n.__pluginType}('${n.__pluginName}') */
|
|
3
|
+
`,_=n.__pluginPath?`(require(${f(n.__pluginPath)}))`:n.__pluginConstructorName;if(_){let E=f(n.__pluginArgs).slice(1,-1);return`${m}new ${_}(${E})`}return m+f(n.__pluginArgs&&n.__pluginArgs.length?{args:n.__pluginArgs}:{})}if(n&&n.__ruleNames){let m=n.__ruleTypes;return`/* ${s}.module${n.__ruleNames.map((E,T)=>`.${m?m[T]:"rule"}('${E}')`).join("")}${n.__useName?`.use('${n.__useName}')`:""} */
|
|
4
|
+
`+f(n)}return n&&n.__expression?n.__expression:typeof n=="function"&&!t&&n.toString().length>100?"function () { /* omitted long function */ }":f(n)},2)}entry(e){return this.entryPoints.getOrCompute(e,()=>new a(this))}plugin(e){return this.plugins.getOrCompute(e,()=>new g(this,e))}toConfig(){let e=this.entryPoints.entries()||{};return this.clean(Object.assign(this.entries()||{},{node:this.node.entries(),output:this.output.entries(),resolve:this.resolve.toConfig(),resolveLoader:this.resolveLoader.toConfig(),devServer:this.devServer.toConfig(),module:this.module.toConfig(),optimization:this.optimization.toConfig(),plugins:this.plugins.values().map(t=>t.toConfig()),performance:this.performance.entries(),entry:Object.keys(e).reduce((t,s)=>Object.assign(t,{[s]:e[s].values()}),{})}))}toString(e){return o.toString(this.toConfig(),e)}merge(e={},t=[]){let s=["node","output","resolve","resolveLoader","devServer","optimization","performance","module"];return!t.includes("entry")&&"entry"in e&&Object.keys(e.entry).forEach(i=>this.entry(i).merge([].concat(e.entry[i]))),!t.includes("plugin")&&"plugin"in e&&Object.keys(e.plugin).forEach(i=>this.plugin(i).merge(e.plugin[i])),s.forEach(i=>{!t.includes(i)&&i in e&&this[i].merge(e[i])}),super.merge(e,[...t,...s,"entry","plugin"])}};export{k as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empjs/chain",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "emp chain",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
},
|
|
46
46
|
"author": "Ken",
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@types/node": "^24.1.0",
|
|
49
48
|
"tsup": "^8.1.0"
|
|
50
49
|
},
|
|
51
50
|
"dependencies": {
|