@empjs/chain 1.1.0 → 4.0.0-alpha.1
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/Chainable.d.ts +6 -0
- package/dist/ChainedMap.d.ts +22 -0
- package/dist/ChainedSet.d.ts +13 -0
- package/dist/Config.d.ts +33 -0
- package/dist/DevServer.d.ts +8 -0
- package/dist/Module.d.ts +12 -0
- package/dist/Optimization.d.ts +34 -0
- package/dist/Orderable.d.ts +12 -0
- package/dist/Output.d.ts +4 -0
- package/dist/Performance.d.ts +8 -0
- package/dist/Plugin.d.ts +23 -0
- package/dist/Resolve.d.ts +23 -0
- package/dist/ResolveLoader.d.ts +9 -0
- package/dist/Rule.d.ts +36 -0
- package/dist/Use.d.ts +21 -0
- package/dist/index.d.ts +3 -161
- package/dist/index.js +3 -4
- package/package.json +10 -17
- package/dist/index.cjs +0 -4
- package/dist/index.d.cts +0 -161
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import Chainable from './Chainable';
|
|
2
|
+
export default class ChainedMap extends Chainable {
|
|
3
|
+
store: Map<string, any>;
|
|
4
|
+
shorthands?: string[];
|
|
5
|
+
constructor(parent: any);
|
|
6
|
+
extend(methods: string[]): this;
|
|
7
|
+
clear(): this;
|
|
8
|
+
delete(key: string): this;
|
|
9
|
+
order(): {
|
|
10
|
+
entries: Record<string, any>;
|
|
11
|
+
order: string[];
|
|
12
|
+
};
|
|
13
|
+
entries(): Record<string, any> | undefined;
|
|
14
|
+
values(): any[];
|
|
15
|
+
get(key: string): any;
|
|
16
|
+
getOrCompute(key: string, fn: () => any): any;
|
|
17
|
+
has(key: string): boolean;
|
|
18
|
+
set(key: string, value: any): this;
|
|
19
|
+
merge(obj: Record<string, any>, omit?: string[]): this;
|
|
20
|
+
clean(obj: Record<string, any>): Record<string, any>;
|
|
21
|
+
when(condition: any, whenTruthy?: (instance: this) => void, whenFalsy?: (instance: this) => void): this;
|
|
22
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Chainable from './Chainable';
|
|
2
|
+
export default class ChainedSet extends Chainable {
|
|
3
|
+
store: Set<any>;
|
|
4
|
+
constructor(parent: any);
|
|
5
|
+
add(value: any): this;
|
|
6
|
+
prepend(value: any): this;
|
|
7
|
+
clear(): this;
|
|
8
|
+
delete(value: any): this;
|
|
9
|
+
values(): any[];
|
|
10
|
+
has(value: any): boolean;
|
|
11
|
+
merge(arr: any[]): this;
|
|
12
|
+
when(condition: any, whenTruthy?: (instance: this) => void, whenFalsy?: (instance: this) => void): this;
|
|
13
|
+
}
|
package/dist/Config.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import ChainedMap from './ChainedMap';
|
|
2
|
+
import ChainedSet from './ChainedSet';
|
|
3
|
+
import DevServer from './DevServer';
|
|
4
|
+
import Module from './Module';
|
|
5
|
+
import Optimization from './Optimization';
|
|
6
|
+
import Output from './Output';
|
|
7
|
+
import Performance from './Performance';
|
|
8
|
+
import Resolve from './Resolve';
|
|
9
|
+
import ResolveLoader from './ResolveLoader';
|
|
10
|
+
declare class Config extends ChainedMap {
|
|
11
|
+
devServer: DevServer;
|
|
12
|
+
entryPoints: ChainedMap;
|
|
13
|
+
module: Module;
|
|
14
|
+
node: ChainedMap;
|
|
15
|
+
optimization: Optimization;
|
|
16
|
+
output: Output;
|
|
17
|
+
performance: Performance;
|
|
18
|
+
plugins: ChainedMap;
|
|
19
|
+
resolve: Resolve;
|
|
20
|
+
resolveLoader: ResolveLoader;
|
|
21
|
+
constructor();
|
|
22
|
+
static toString(config: any, { verbose, configPrefix }?: {
|
|
23
|
+
verbose?: boolean | undefined;
|
|
24
|
+
configPrefix?: string | undefined;
|
|
25
|
+
}): string;
|
|
26
|
+
entry(name: string): ChainedSet;
|
|
27
|
+
plugin(name: string): any;
|
|
28
|
+
toConfig(): any;
|
|
29
|
+
toString(options?: any): string;
|
|
30
|
+
merge(obj?: any, omit?: string[]): this;
|
|
31
|
+
}
|
|
32
|
+
export default Config;
|
|
33
|
+
export { Config as 'module.exports' };
|
package/dist/Module.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import ChainedMap from './ChainedMap';
|
|
2
|
+
export default class Module extends ChainedMap {
|
|
3
|
+
rules: ChainedMap;
|
|
4
|
+
defaultRules: ChainedMap;
|
|
5
|
+
constructor(parent: any);
|
|
6
|
+
noParse(value: RegExp | RegExp[] | ((resource: string) => boolean) | Array<(resource: string) => boolean> | string | Array<string | RegExp>): this;
|
|
7
|
+
strictExportPresence(value: boolean): this;
|
|
8
|
+
defaultRule(name: string): any;
|
|
9
|
+
rule(name: string): any;
|
|
10
|
+
toConfig(): any;
|
|
11
|
+
merge(obj: any, omit?: string[]): this;
|
|
12
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import ChainedMap from './ChainedMap';
|
|
2
|
+
export default class Optimization extends ChainedMap {
|
|
3
|
+
minimizers: ChainedMap;
|
|
4
|
+
constructor(parent: any);
|
|
5
|
+
splitChunks(value: false | {
|
|
6
|
+
chunks?: 'all' | 'async' | 'initial';
|
|
7
|
+
minSize?: number;
|
|
8
|
+
minChunks?: number;
|
|
9
|
+
automaticNameDelimiter?: string;
|
|
10
|
+
cacheGroups?: Record<string, any>;
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}): this;
|
|
13
|
+
concatenateModules(value: boolean): this;
|
|
14
|
+
flagIncludedChunks(value: boolean): this;
|
|
15
|
+
mergeDuplicateChunks(value: boolean): this;
|
|
16
|
+
minimize(value: boolean): this;
|
|
17
|
+
namedChunks(value: boolean | string): this;
|
|
18
|
+
namedModules(value: boolean | string): this;
|
|
19
|
+
nodeEnv(value: string | boolean): this;
|
|
20
|
+
noEmitOnErrors(value: boolean): this;
|
|
21
|
+
occurrenceOrder(value: boolean): this;
|
|
22
|
+
portableRecords(value: boolean): this;
|
|
23
|
+
providedExports(value: boolean): this;
|
|
24
|
+
removeAvailableModules(value: boolean): this;
|
|
25
|
+
removeEmptyChunks(value: boolean): this;
|
|
26
|
+
runtimeChunk(value: boolean | 'single' | 'multiple' | {
|
|
27
|
+
name?: string | ((entryPoint: any) => string);
|
|
28
|
+
}): this;
|
|
29
|
+
sideEffects(value: boolean): this;
|
|
30
|
+
usedExports(value: boolean | 'global'): this;
|
|
31
|
+
minimizer(name: string | any[]): any;
|
|
32
|
+
toConfig(): any;
|
|
33
|
+
merge(obj: any, omit?: string[]): this;
|
|
34
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type Constructor<T = any> = new (...args: any[]) => T;
|
|
2
|
+
export default function Orderable<TBase extends Constructor>(Base: TBase): {
|
|
3
|
+
new (...args: any[]): {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
__before?: string;
|
|
6
|
+
__after?: string;
|
|
7
|
+
before(name: string): /*elided*/ any;
|
|
8
|
+
after(name: string): /*elided*/ any;
|
|
9
|
+
merge(obj: any, omit?: string[]): /*elided*/ any;
|
|
10
|
+
};
|
|
11
|
+
} & TBase;
|
|
12
|
+
export {};
|
package/dist/Output.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import ChainedMap from './ChainedMap';
|
|
2
|
+
export default class Performance extends ChainedMap {
|
|
3
|
+
constructor(parent: any);
|
|
4
|
+
assetFilter(value: (assetFilename: string) => boolean): this;
|
|
5
|
+
hints(value: 'warning' | 'error' | false): this;
|
|
6
|
+
maxAssetSize(value: number): this;
|
|
7
|
+
maxEntrypointSize(value: number): this;
|
|
8
|
+
}
|
package/dist/Plugin.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import ChainedMap from './ChainedMap';
|
|
2
|
+
declare class PluginBase extends ChainedMap {
|
|
3
|
+
name: string;
|
|
4
|
+
type: string;
|
|
5
|
+
init: any;
|
|
6
|
+
constructor(parent: any, name: string, type?: string);
|
|
7
|
+
use(plugin: any, args?: any[]): this;
|
|
8
|
+
tap(f: (args: any[]) => any[]): this;
|
|
9
|
+
set(key: string, value: any): this;
|
|
10
|
+
merge(obj: any, omit?: string[]): this;
|
|
11
|
+
toConfig(): any;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: {
|
|
14
|
+
new (...args: any[]): {
|
|
15
|
+
[x: string]: any;
|
|
16
|
+
__before?: string;
|
|
17
|
+
__after?: string;
|
|
18
|
+
before(name: string): /*elided*/ any;
|
|
19
|
+
after(name: string): /*elided*/ any;
|
|
20
|
+
merge(obj: any, omit?: string[]): /*elided*/ any;
|
|
21
|
+
};
|
|
22
|
+
} & typeof PluginBase;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import ChainedMap from './ChainedMap';
|
|
2
|
+
import ChainedSet from './ChainedSet';
|
|
3
|
+
export default class Resolve extends ChainedMap {
|
|
4
|
+
alias: ChainedMap;
|
|
5
|
+
aliasFields: ChainedSet;
|
|
6
|
+
descriptionFiles: ChainedSet;
|
|
7
|
+
extensions: ChainedSet;
|
|
8
|
+
mainFields: ChainedSet;
|
|
9
|
+
mainFiles: ChainedSet;
|
|
10
|
+
modules: ChainedSet;
|
|
11
|
+
plugins: ChainedMap;
|
|
12
|
+
constructor(parent: any);
|
|
13
|
+
cachePredicate(value: (request: string, context?: Record<string, any>) => boolean): this;
|
|
14
|
+
cacheWithContext(value: boolean): this;
|
|
15
|
+
concord(value: Record<string, unknown>): this;
|
|
16
|
+
enforceExtension(value: boolean): this;
|
|
17
|
+
enforceModuleExtension(value: boolean): this;
|
|
18
|
+
symlinks(value: boolean): this;
|
|
19
|
+
unsafeCache(value: boolean | RegExp | ((request: string) => boolean)): this;
|
|
20
|
+
plugin(name: string): any;
|
|
21
|
+
toConfig(): any;
|
|
22
|
+
merge(obj: any, omit?: string[]): this;
|
|
23
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import ChainedSet from './ChainedSet';
|
|
2
|
+
import Resolve from './Resolve';
|
|
3
|
+
export default class ResolveLoader extends Resolve {
|
|
4
|
+
moduleExtensions: ChainedSet;
|
|
5
|
+
packageMains: ChainedSet;
|
|
6
|
+
constructor(parent: any);
|
|
7
|
+
toConfig(): any;
|
|
8
|
+
merge(obj: any, omit?: string[]): this;
|
|
9
|
+
}
|
package/dist/Rule.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import ChainedMap from './ChainedMap';
|
|
2
|
+
import ChainedSet from './ChainedSet';
|
|
3
|
+
import Resolve from './Resolve';
|
|
4
|
+
declare class RuleBase extends ChainedMap {
|
|
5
|
+
name: string;
|
|
6
|
+
names: string[];
|
|
7
|
+
ruleType: string;
|
|
8
|
+
ruleTypes: string[];
|
|
9
|
+
uses: ChainedMap;
|
|
10
|
+
include: ChainedSet;
|
|
11
|
+
exclude: ChainedSet;
|
|
12
|
+
rules: ChainedMap;
|
|
13
|
+
oneOfs: ChainedMap;
|
|
14
|
+
resolve: Resolve;
|
|
15
|
+
enforce: any;
|
|
16
|
+
test: any;
|
|
17
|
+
constructor(parent: any, name: string, ruleType?: string);
|
|
18
|
+
use(name: string): any;
|
|
19
|
+
rule(name: string): any;
|
|
20
|
+
oneOf(name: string): any;
|
|
21
|
+
pre(): this;
|
|
22
|
+
post(): this;
|
|
23
|
+
toConfig(): any;
|
|
24
|
+
merge(obj: any, omit?: string[]): this;
|
|
25
|
+
}
|
|
26
|
+
declare const Rule: {
|
|
27
|
+
new (...args: any[]): {
|
|
28
|
+
[x: string]: any;
|
|
29
|
+
__before?: string;
|
|
30
|
+
__after?: string;
|
|
31
|
+
before(name: string): /*elided*/ any;
|
|
32
|
+
after(name: string): /*elided*/ any;
|
|
33
|
+
merge(obj: any, omit?: string[]): /*elided*/ any;
|
|
34
|
+
};
|
|
35
|
+
} & typeof RuleBase;
|
|
36
|
+
export default Rule;
|
package/dist/Use.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import ChainedMap from './ChainedMap';
|
|
2
|
+
declare class UseBase extends ChainedMap {
|
|
3
|
+
name: string;
|
|
4
|
+
constructor(parent: any, name: string);
|
|
5
|
+
loader(value: string): this;
|
|
6
|
+
options(value: Record<string, any>): this;
|
|
7
|
+
tap(f: (options: any) => any): this;
|
|
8
|
+
merge(obj: any, omit?: string[]): this;
|
|
9
|
+
toConfig(): any;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: {
|
|
12
|
+
new (...args: any[]): {
|
|
13
|
+
[x: string]: any;
|
|
14
|
+
__before?: string;
|
|
15
|
+
__after?: string;
|
|
16
|
+
before(name: string): /*elided*/ any;
|
|
17
|
+
after(name: string): /*elided*/ any;
|
|
18
|
+
merge(obj: any, omit?: string[]): /*elided*/ any;
|
|
19
|
+
};
|
|
20
|
+
} & typeof UseBase;
|
|
21
|
+
export default _default;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,161 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
batch(handler: (instance: this) => void): this;
|
|
5
|
-
end(): any;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
declare class ChainedMap extends Chainable {
|
|
9
|
-
store: Map<string, any>;
|
|
10
|
-
shorthands?: string[];
|
|
11
|
-
constructor(parent: any);
|
|
12
|
-
extend(methods: string[]): this;
|
|
13
|
-
clear(): this;
|
|
14
|
-
delete(key: string): this;
|
|
15
|
-
order(): {
|
|
16
|
-
entries: Record<string, any>;
|
|
17
|
-
order: string[];
|
|
18
|
-
};
|
|
19
|
-
entries(): Record<string, any> | undefined;
|
|
20
|
-
values(): any[];
|
|
21
|
-
get(key: string): any;
|
|
22
|
-
getOrCompute(key: string, fn: () => any): any;
|
|
23
|
-
has(key: string): boolean;
|
|
24
|
-
set(key: string, value: any): this;
|
|
25
|
-
merge(obj: Record<string, any>, omit?: string[]): this;
|
|
26
|
-
clean(obj: Record<string, any>): Record<string, any>;
|
|
27
|
-
when(condition: any, whenTruthy?: (instance: this) => void, whenFalsy?: (instance: this) => void): this;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
declare class ChainedSet extends Chainable {
|
|
31
|
-
store: Set<any>;
|
|
32
|
-
constructor(parent: any);
|
|
33
|
-
add(value: any): this;
|
|
34
|
-
prepend(value: any): this;
|
|
35
|
-
clear(): this;
|
|
36
|
-
delete(value: any): this;
|
|
37
|
-
values(): any[];
|
|
38
|
-
has(value: any): boolean;
|
|
39
|
-
merge(arr: any[]): this;
|
|
40
|
-
when(condition: any, whenTruthy?: (instance: this) => void, whenFalsy?: (instance: this) => void): this;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
declare class DevServer extends ChainedMap {
|
|
44
|
-
allowedHosts: ChainedSet;
|
|
45
|
-
constructor(parent: any);
|
|
46
|
-
toConfig(): any;
|
|
47
|
-
merge(obj: any, omit?: string[]): this;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
declare class Module extends ChainedMap {
|
|
51
|
-
rules: ChainedMap;
|
|
52
|
-
defaultRules: ChainedMap;
|
|
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;
|
|
56
|
-
defaultRule(name: string): any;
|
|
57
|
-
rule(name: string): any;
|
|
58
|
-
toConfig(): any;
|
|
59
|
-
merge(obj: any, omit?: string[]): this;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
declare class Optimization extends ChainedMap {
|
|
63
|
-
minimizers: ChainedMap;
|
|
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;
|
|
91
|
-
minimizer(name: string | any[]): any;
|
|
92
|
-
toConfig(): any;
|
|
93
|
-
merge(obj: any, omit?: string[]): this;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
declare class Output extends ChainedMap {
|
|
97
|
-
constructor(parent: any);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
declare class Performance extends ChainedMap {
|
|
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;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
declare class Resolve extends ChainedMap {
|
|
109
|
-
alias: ChainedMap;
|
|
110
|
-
aliasFields: ChainedSet;
|
|
111
|
-
descriptionFiles: ChainedSet;
|
|
112
|
-
extensions: ChainedSet;
|
|
113
|
-
mainFields: ChainedSet;
|
|
114
|
-
mainFiles: ChainedSet;
|
|
115
|
-
modules: ChainedSet;
|
|
116
|
-
plugins: ChainedMap;
|
|
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;
|
|
125
|
-
plugin(name: string): any;
|
|
126
|
-
toConfig(): any;
|
|
127
|
-
merge(obj: any, omit?: string[]): this;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
declare class ResolveLoader extends Resolve {
|
|
131
|
-
moduleExtensions: ChainedSet;
|
|
132
|
-
packageMains: ChainedSet;
|
|
133
|
-
constructor(parent: any);
|
|
134
|
-
toConfig(): any;
|
|
135
|
-
merge(obj: any, omit?: string[]): this;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
declare class Config extends ChainedMap {
|
|
139
|
-
devServer: DevServer;
|
|
140
|
-
entryPoints: ChainedMap;
|
|
141
|
-
module: Module;
|
|
142
|
-
node: ChainedMap;
|
|
143
|
-
optimization: Optimization;
|
|
144
|
-
output: Output;
|
|
145
|
-
performance: Performance;
|
|
146
|
-
plugins: ChainedMap;
|
|
147
|
-
resolve: Resolve;
|
|
148
|
-
resolveLoader: ResolveLoader;
|
|
149
|
-
constructor();
|
|
150
|
-
static toString(config: any, { verbose, configPrefix }?: {
|
|
151
|
-
verbose?: boolean | undefined;
|
|
152
|
-
configPrefix?: string | undefined;
|
|
153
|
-
}): string;
|
|
154
|
-
entry(name: string): ChainedSet;
|
|
155
|
-
plugin(name: string): any;
|
|
156
|
-
toConfig(): any;
|
|
157
|
-
toString(options?: any): string;
|
|
158
|
-
merge(obj?: any, omit?: string[]): this;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export { Config as default };
|
|
1
|
+
import Config from './Config';
|
|
2
|
+
export default Config;
|
|
3
|
+
export { Config as 'module.exports' };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
|
|
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
|
-
|
|
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};
|
|
1
|
+
import e from"node:module";let t=e.createRequire(import.meta.url);import s from"deepmerge";var i={},r={};function n(e){var t=r[e];if(void 0!==t)return t.exports;var s=r[e]={exports:{}};return i[e](s,s.exports,n),s.exports}n.m=i,n.add=function(e){Object.assign(n.m,e)},n.add({"javascript-stringify"(e){e.exports=t("javascript-stringify")}});class o{parent;constructor(e){this.parent=e}batch(e){return e(this),this}end(){return this.parent}}class u extends o{store;shorthands;constructor(e){super(e),this.store=new Map}extend(e){return this.shorthands=e,e.forEach(e=>{this[e]=t=>this.set(e,t)}),this}clear(){return this.store.clear(),this}delete(e){return this.store.delete(e),this}order(){let e=[...this.store].reduce((e,[t,s])=>(e[t]=s,e),{}),t=Object.keys(e),s=[...t];return t.forEach(t=>{if(!e[t])return;let{__before:i,__after:r}=e[t];i&&s.includes(i)?(s.splice(s.indexOf(t),1),s.splice(s.indexOf(i),0,t)):r&&s.includes(r)&&(s.splice(s.indexOf(t),1),s.splice(s.indexOf(r)+1,0,t))}),{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(t=>e[t])}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(i=>{if(t.includes(i))return;let r=e[i];(Array.isArray(r)||"object"==typeof r)&&null!==r&&this.has(i)?this.set(i,s(this.get(i),r)):this.set(i,r)}),this}clean(e){return Object.keys(e).reduce((t,s)=>{let i=e[s];return void 0===i||Array.isArray(i)&&!i.length||"[object Object]"===Object.prototype.toString.call(i)&&!Object.keys(i).length||(t[s]=i),t},{})}when(e,t=Function.prototype,s=Function.prototype){return e?t(this):s(this),this}}class l extends o{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}}class a extends u{allowedHosts;constructor(e){super(e),this.allowedHosts=new l(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 h(e){return class extends e{__before;__after;before(e){if(this.__after)throw Error(`Unable to set .before(${JSON.stringify(e)}) with existing value for .after()`);return this.__before=e,this}after(e){if(this.__before)throw 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"])}}}let c=h(class extends u{name;type;init;constructor(e,t,s="plugin"){super(e),this.name=t,this.type=s,this.extend(["init"]),this.init((e,t=[])=>"function"==typeof e?new e(...t):e)}use(e,t=[]){return this.set("plugin",e).set("args",t)}tap(e){if(!this.has("plugin"))throw 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("args"===e&&!Array.isArray(t))throw 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"),s=this.get("plugin"),i=this.get("args"),r=null;if(void 0===s)throw Error(`Invalid ${this.type} configuration: ${this.type}('${this.name}').use(<Plugin>) was not called to specify the plugin`);"string"==typeof s&&(s=t(r=s));let n=s.__expression?`(${s.__expression})`:s.name,o=e(s,i);for(let[e,t]of Object.entries({__pluginName:this.name,__pluginType:this.type,__pluginArgs:i,__pluginConstructorName:n,__pluginPath:r})){let s=Object.getOwnPropertyDescriptor(o,e);if(!s||!1!==s.configurable)try{Object.defineProperty(o,e,{value:t,configurable:!0})}catch{}}return o}});class p extends u{alias;aliasFields;descriptionFiles;extensions;mainFields;mainFiles;modules;plugins;constructor(e){super(e),this.alias=new u(this),this.aliasFields=new l(this),this.descriptionFiles=new l(this),this.extensions=new l(this),this.mainFields=new l(this),this.mainFiles=new l(this),this.modules=new l(this),this.plugins=new u(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(t=>this.plugin(t).merge(e.plugin[t])),s.forEach(s=>{!t.includes(s)&&s in e&&this[s].merge(e[s])}),super.merge(e,[...t,...s,"plugin"])}}let d=h(class extends u{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(s(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}});function m(e){return Array.isArray(e)?e:[e]}let g=h(class e extends u{name;names;ruleType;ruleTypes;uses;include;exclude;rules;oneOfs;resolve;enforce;test;constructor(t,s,i="rule"){super(t),this.name=s,this.names=[],this.ruleType=i,this.ruleTypes=[];let r=this;for(;r instanceof e;)this.names.unshift(r.name),this.ruleTypes.unshift(r.ruleType),r=r.parent;this.uses=new u(this),this.include=new l(this),this.exclude=new l(this),this.rules=new u(this),this.oneOfs=new u(this),this.resolve=new p(this),this.extend(["enforce","issuer","parser","resource","resourceQuery","sideEffects","test","type"])}use(e){return this.uses.getOrCompute(e,()=>new d(this,e))}rule(t){return this.rules.getOrCompute(t,()=>new e(this,t,"rule"))}oneOf(t){return this.oneOfs.getOrCompute(t,()=>new e(this,t,"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(e=>e.toConfig()),oneOf:this.oneOfs.values().map(e=>e.toConfig()),use:this.uses.values().map(e=>e.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(m(e.include)),!t.includes("exclude")&&"exclude"in e&&this.exclude.merge(m(e.exclude)),!t.includes("use")&&"use"in e&&Object.keys(e.use).forEach(t=>this.use(t).merge(e.use[t])),!t.includes("rules")&&"rules"in e&&Object.keys(e.rules).forEach(t=>this.rule(t).merge(e.rules[t])),!t.includes("oneOf")&&"oneOf"in e&&Object.keys(e.oneOf).forEach(t=>this.oneOf(t).merge(e.oneOf[t])),!t.includes("resolve")&&"resolve"in e&&this.resolve.merge(e.resolve),!t.includes("test")&&"test"in e&&this.test(e.test instanceof RegExp||"function"==typeof e.test?e.test:new RegExp(e.test)),super.merge(e,[...t,"include","exclude","use","rules","oneOf","resolve","test"])}});class f extends u{rules;defaultRules;constructor(e){super(e),this.rules=new u(this),this.defaultRules=new u(this)}noParse(e){return this.set("noParse",e)}strictExportPresence(e){return this.set("strictExportPresence",e)}defaultRule(e){return this.defaultRules.getOrCompute(e,()=>new g(this,e,"defaultRule"))}rule(e){return this.rules.getOrCompute(e,()=>new g(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(t=>this.rule(t).merge(e.rule[t])),!t.includes("defaultRule")&&"defaultRule"in e&&Object.keys(e.defaultRule).forEach(t=>this.defaultRule(t).merge(e.defaultRule[t])),super.merge(e,["rule","defaultRule"])}}class y extends u{minimizers;constructor(e){super(e),this.minimizers=new u(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 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(t=>this.minimizer(t).merge(e.minimizer[t])),super.merge(e,[...t,"minimizer"])}}class x extends u{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"])}}class v extends u{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)}}class w extends p{moduleExtensions;packageMains;constructor(e){super(e),this.moduleExtensions=new l(this),this.packageMains=new l(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(s=>{!t.includes(s)&&s in e&&this[s].merge(e[s])}),super.merge(e,[...t,...s])}}let b=class e extends u{devServer;entryPoints;module;node;optimization;output;performance;plugins;resolve;resolveLoader;constructor(){super({}),this.devServer=new a(this),this.entryPoints=new u(this),this.module=new f(this),this.node=new u(this),this.optimization=new y(this),this.output=new x(this),this.performance=new v(this),this.plugins=new u(this),this.resolve=new p(this),this.resolveLoader=new w(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}=n("javascript-stringify");return i(e,(e,i,r)=>{if(e&&e.__pluginName){let t=`/* ${s}.${e.__pluginType}('${e.__pluginName}') */
|
|
2
|
+
`,i=e.__pluginPath?`(require(${r(e.__pluginPath)}))`:e.__pluginConstructorName;if(i){let s=r(e.__pluginArgs).slice(1,-1);return`${t}new ${i}(${s})`}return t+r(e.__pluginArgs&&e.__pluginArgs.length?{args:e.__pluginArgs}:{})}if(e&&e.__ruleNames){let t=e.__ruleTypes;return`/* ${s}.module${e.__ruleNames.map((e,s)=>`.${t?t[s]:"rule"}('${e}')`).join("")}${e.__useName?`.use('${e.__useName}')`:""} */
|
|
3
|
+
`+r(e)}return e&&e.__expression?e.__expression:"function"==typeof e&&!t&&e.toString().length>100?"function () { /* omitted long function */ }":r(e)},2)}entry(e){return this.entryPoints.getOrCompute(e,()=>new l(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(e=>e.toConfig()),performance:this.performance.entries(),entry:Object.keys(e).reduce((t,s)=>Object.assign(t,{[s]:e[s].values()}),{})}))}toString(t){return e.toString(this.toConfig(),t)}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(t=>this.entry(t).merge([].concat(e.entry[t]))),!t.includes("plugin")&&"plugin"in e&&Object.keys(e.plugin).forEach(t=>this.plugin(t).merge(e.plugin[t])),s.forEach(s=>{!t.includes(s)&&s in e&&this[s].merge(e[s])}),super.merge(e,[...t,...s,"entry","plugin"])}};export default b;export{b as "module.exports"};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empjs/chain",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha.1",
|
|
4
4
|
"description": "emp chain",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -26,33 +26,26 @@
|
|
|
26
26
|
"fluent",
|
|
27
27
|
"api"
|
|
28
28
|
],
|
|
29
|
-
"main": "dist/index.js",
|
|
30
|
-
"types": "dist/index.d.ts",
|
|
29
|
+
"main": "./dist/index.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
31
|
"exports": {
|
|
32
32
|
".": {
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
"require": {
|
|
38
|
-
"types": "./dist/index.d.cts",
|
|
39
|
-
"default": "./dist/index.cjs"
|
|
40
|
-
}
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"import": "./dist/index.js",
|
|
35
|
+
"default": "./dist/index.js"
|
|
41
36
|
}
|
|
42
37
|
},
|
|
43
38
|
"engines": {
|
|
44
|
-
"node": "
|
|
39
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
45
40
|
},
|
|
46
41
|
"author": "Ken",
|
|
47
|
-
"devDependencies": {
|
|
48
|
-
"tsup": "^8.1.0"
|
|
49
|
-
},
|
|
50
42
|
"dependencies": {
|
|
51
43
|
"deepmerge": "^1.5.2",
|
|
52
44
|
"javascript-stringify": "^2.0.1"
|
|
53
45
|
},
|
|
54
46
|
"scripts": {
|
|
55
|
-
"build": "
|
|
56
|
-
"dev": "
|
|
47
|
+
"build": "rslib build --env-mode production",
|
|
48
|
+
"dev": "rslib build --watch --env-mode development",
|
|
49
|
+
"test": "node test/plugin-metadata.test.mjs"
|
|
57
50
|
}
|
|
58
51
|
}
|
package/dist/index.cjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
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
|
-
`+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
|
-
if (module.exports.default) module.exports = module.exports.default;
|
package/dist/index.d.cts
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
declare class Chainable {
|
|
2
|
-
parent: any;
|
|
3
|
-
constructor(parent: any);
|
|
4
|
-
batch(handler: (instance: this) => void): this;
|
|
5
|
-
end(): any;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
declare class ChainedMap extends Chainable {
|
|
9
|
-
store: Map<string, any>;
|
|
10
|
-
shorthands?: string[];
|
|
11
|
-
constructor(parent: any);
|
|
12
|
-
extend(methods: string[]): this;
|
|
13
|
-
clear(): this;
|
|
14
|
-
delete(key: string): this;
|
|
15
|
-
order(): {
|
|
16
|
-
entries: Record<string, any>;
|
|
17
|
-
order: string[];
|
|
18
|
-
};
|
|
19
|
-
entries(): Record<string, any> | undefined;
|
|
20
|
-
values(): any[];
|
|
21
|
-
get(key: string): any;
|
|
22
|
-
getOrCompute(key: string, fn: () => any): any;
|
|
23
|
-
has(key: string): boolean;
|
|
24
|
-
set(key: string, value: any): this;
|
|
25
|
-
merge(obj: Record<string, any>, omit?: string[]): this;
|
|
26
|
-
clean(obj: Record<string, any>): Record<string, any>;
|
|
27
|
-
when(condition: any, whenTruthy?: (instance: this) => void, whenFalsy?: (instance: this) => void): this;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
declare class ChainedSet extends Chainable {
|
|
31
|
-
store: Set<any>;
|
|
32
|
-
constructor(parent: any);
|
|
33
|
-
add(value: any): this;
|
|
34
|
-
prepend(value: any): this;
|
|
35
|
-
clear(): this;
|
|
36
|
-
delete(value: any): this;
|
|
37
|
-
values(): any[];
|
|
38
|
-
has(value: any): boolean;
|
|
39
|
-
merge(arr: any[]): this;
|
|
40
|
-
when(condition: any, whenTruthy?: (instance: this) => void, whenFalsy?: (instance: this) => void): this;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
declare class DevServer extends ChainedMap {
|
|
44
|
-
allowedHosts: ChainedSet;
|
|
45
|
-
constructor(parent: any);
|
|
46
|
-
toConfig(): any;
|
|
47
|
-
merge(obj: any, omit?: string[]): this;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
declare class Module extends ChainedMap {
|
|
51
|
-
rules: ChainedMap;
|
|
52
|
-
defaultRules: ChainedMap;
|
|
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;
|
|
56
|
-
defaultRule(name: string): any;
|
|
57
|
-
rule(name: string): any;
|
|
58
|
-
toConfig(): any;
|
|
59
|
-
merge(obj: any, omit?: string[]): this;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
declare class Optimization extends ChainedMap {
|
|
63
|
-
minimizers: ChainedMap;
|
|
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;
|
|
91
|
-
minimizer(name: string | any[]): any;
|
|
92
|
-
toConfig(): any;
|
|
93
|
-
merge(obj: any, omit?: string[]): this;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
declare class Output extends ChainedMap {
|
|
97
|
-
constructor(parent: any);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
declare class Performance extends ChainedMap {
|
|
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;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
declare class Resolve extends ChainedMap {
|
|
109
|
-
alias: ChainedMap;
|
|
110
|
-
aliasFields: ChainedSet;
|
|
111
|
-
descriptionFiles: ChainedSet;
|
|
112
|
-
extensions: ChainedSet;
|
|
113
|
-
mainFields: ChainedSet;
|
|
114
|
-
mainFiles: ChainedSet;
|
|
115
|
-
modules: ChainedSet;
|
|
116
|
-
plugins: ChainedMap;
|
|
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;
|
|
125
|
-
plugin(name: string): any;
|
|
126
|
-
toConfig(): any;
|
|
127
|
-
merge(obj: any, omit?: string[]): this;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
declare class ResolveLoader extends Resolve {
|
|
131
|
-
moduleExtensions: ChainedSet;
|
|
132
|
-
packageMains: ChainedSet;
|
|
133
|
-
constructor(parent: any);
|
|
134
|
-
toConfig(): any;
|
|
135
|
-
merge(obj: any, omit?: string[]): this;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
declare class Config extends ChainedMap {
|
|
139
|
-
devServer: DevServer;
|
|
140
|
-
entryPoints: ChainedMap;
|
|
141
|
-
module: Module;
|
|
142
|
-
node: ChainedMap;
|
|
143
|
-
optimization: Optimization;
|
|
144
|
-
output: Output;
|
|
145
|
-
performance: Performance;
|
|
146
|
-
plugins: ChainedMap;
|
|
147
|
-
resolve: Resolve;
|
|
148
|
-
resolveLoader: ResolveLoader;
|
|
149
|
-
constructor();
|
|
150
|
-
static toString(config: any, { verbose, configPrefix }?: {
|
|
151
|
-
verbose?: boolean | undefined;
|
|
152
|
-
configPrefix?: string | undefined;
|
|
153
|
-
}): string;
|
|
154
|
-
entry(name: string): ChainedSet;
|
|
155
|
-
plugin(name: string): any;
|
|
156
|
-
toConfig(): any;
|
|
157
|
-
toString(options?: any): string;
|
|
158
|
-
merge(obj?: any, omit?: string[]): this;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export { Config as default };
|