webpack 4.19.0 → 4.20.2

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.
Files changed (53) hide show
  1. package/README.md +4 -0
  2. package/lib/AmdMainTemplatePlugin.js +5 -3
  3. package/lib/BannerPlugin.js +13 -5
  4. package/lib/Chunk.js +3 -0
  5. package/lib/Compilation.js +23 -18
  6. package/lib/Compiler.js +6 -12
  7. package/lib/DllPlugin.js +5 -0
  8. package/lib/DllReferencePlugin.js +70 -46
  9. package/lib/DynamicEntryPlugin.js +4 -3
  10. package/lib/EntryOptionPlugin.js +2 -1
  11. package/lib/ExternalModule.js +16 -4
  12. package/lib/HashedModuleIdsPlugin.js +9 -1
  13. package/lib/HotUpdateChunk.js +1 -0
  14. package/lib/IgnorePlugin.js +10 -14
  15. package/lib/LibraryTemplatePlugin.js +33 -10
  16. package/lib/LoaderOptionsPlugin.js +5 -0
  17. package/lib/Module.js +4 -0
  18. package/lib/SourceMapDevToolPlugin.js +16 -3
  19. package/lib/Template.js +1 -0
  20. package/lib/UmdMainTemplatePlugin.js +2 -1
  21. package/lib/WatchIgnorePlugin.js +5 -0
  22. package/lib/WebpackOptionsApply.js +18 -2
  23. package/lib/WebpackOptionsDefaulter.js +5 -1
  24. package/lib/debug/ProfilingPlugin.js +6 -0
  25. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +16 -1
  26. package/lib/dependencies/HarmonyExportExpressionDependency.js +7 -2
  27. package/lib/dependencies/ImportParserPlugin.js +1 -1
  28. package/lib/dependencies/WebAssemblyImportDependency.js +9 -1
  29. package/lib/node/NodeMainTemplatePlugin.js +2 -2
  30. package/lib/optimize/AggressiveSplittingPlugin.js +9 -2
  31. package/lib/optimize/ConcatenatedModule.js +10 -2
  32. package/lib/optimize/LimitChunkCountPlugin.js +9 -2
  33. package/lib/optimize/MinChunkSizePlugin.js +5 -0
  34. package/lib/optimize/OccurrenceChunkOrderPlugin.js +5 -0
  35. package/lib/optimize/OccurrenceModuleOrderPlugin.js +5 -0
  36. package/lib/web/JsonpExportMainTemplatePlugin.js +3 -0
  37. package/lib/webpack.js +12 -1
  38. package/package.json +11 -8
  39. package/schemas/WebpackOptions.json +1293 -1113
  40. package/schemas/plugins/BannerPlugin.json +34 -27
  41. package/schemas/plugins/DllPlugin.json +18 -16
  42. package/schemas/plugins/DllReferencePlugin.json +180 -68
  43. package/schemas/plugins/HashedModuleIdsPlugin.json +9 -3
  44. package/schemas/plugins/IgnorePlugin.json +17 -11
  45. package/schemas/plugins/LoaderOptionsPlugin.json +27 -26
  46. package/schemas/plugins/SourceMapDevToolPlugin.json +87 -83
  47. package/schemas/plugins/WatchIgnorePlugin.json +18 -16
  48. package/schemas/plugins/debug/ProfilingPlugin.json +13 -12
  49. package/schemas/plugins/optimize/AggressiveSplittingPlugin.json +23 -22
  50. package/schemas/plugins/optimize/LimitChunkCountPlugin.json +16 -15
  51. package/schemas/plugins/optimize/MinChunkSizePlugin.json +4 -3
  52. package/schemas/plugins/optimize/OccurrenceOrderChunkIdsPlugin.json +2 -1
  53. package/schemas/plugins/optimize/OccurrenceOrderModuleIdsPlugin.json +2 -1
@@ -1,65 +1,68 @@
1
1
  {
2
2
  "definitions": {
3
- "rule": {
3
+ "BannerFunction": {
4
+ "description": "The banner as function, it will be wrapped in a comment",
5
+ "instanceof": "Function",
6
+ "tsType": "(data: { hash: string, chunk: import('../../lib/Chunk'), filename: string, basename: string, query: string}) => string"
7
+ },
8
+ "Rule": {
4
9
  "oneOf": [
5
10
  {
6
- "instanceof": "RegExp"
11
+ "instanceof": "RegExp",
12
+ "tsType": "RegExp"
7
13
  },
8
14
  {
9
- "minLength": 1,
10
- "type": "string"
15
+ "type": "string",
16
+ "minLength": 1
11
17
  }
12
18
  ]
13
19
  },
14
- "rules": {
20
+ "Rules": {
15
21
  "oneOf": [
16
22
  {
23
+ "type": "array",
17
24
  "items": {
18
25
  "description": "A rule condition",
19
26
  "anyOf": [
20
27
  {
21
- "$ref": "#/definitions/rule"
28
+ "$ref": "#/definitions/Rule"
22
29
  }
23
30
  ]
24
- },
25
- "type": "array"
31
+ }
26
32
  },
27
33
  {
28
- "$ref": "#/definitions/rule"
34
+ "$ref": "#/definitions/Rule"
29
35
  }
30
36
  ]
31
37
  }
32
38
  },
39
+ "title": "BannerPluginArgument",
33
40
  "oneOf": [
34
41
  {
42
+ "title": "BannerPluginOptions",
35
43
  "type": "object",
36
44
  "additionalProperties": false,
37
- "required": ["banner"],
38
45
  "properties": {
39
46
  "banner": {
40
47
  "description": "Specifies the banner",
41
48
  "anyOf": [
42
49
  {
43
- "instanceof": "Function"
50
+ "$ref": "#/definitions/BannerFunction"
44
51
  },
45
52
  {
46
53
  "type": "string"
47
54
  }
48
55
  ]
49
56
  },
50
- "raw": {
51
- "description": "If true, banner will not be wrapped in a comment",
52
- "type": "boolean"
53
- },
54
57
  "entryOnly": {
55
58
  "description": "If true, the banner will only be added to the entry chunks",
56
59
  "type": "boolean"
57
60
  },
58
- "test": {
59
- "description": "Include all modules that pass test assertion",
61
+ "exclude": {
62
+ "description": "Exclude all modules matching any of these conditions",
60
63
  "anyOf": [
61
64
  {
62
- "$ref": "#/definitions/rules"
65
+ "$ref": "#/definitions/Rules"
63
66
  }
64
67
  ]
65
68
  },
@@ -67,28 +70,32 @@
67
70
  "description": "Include all modules matching any of these conditions",
68
71
  "anyOf": [
69
72
  {
70
- "$ref": "#/definitions/rules"
73
+ "$ref": "#/definitions/Rules"
71
74
  }
72
75
  ]
73
76
  },
74
- "exclude": {
75
- "description": "Exclude all modules matching any of these conditions",
77
+ "raw": {
78
+ "description": "If true, banner will not be wrapped in a comment",
79
+ "type": "boolean"
80
+ },
81
+ "test": {
82
+ "description": "Include all modules that pass test assertion",
76
83
  "anyOf": [
77
84
  {
78
- "$ref": "#/definitions/rules"
85
+ "$ref": "#/definitions/Rules"
79
86
  }
80
87
  ]
81
88
  }
82
- }
89
+ },
90
+ "required": ["banner"]
83
91
  },
84
92
  {
85
- "description": "The banner as function, it will be wrapped in a comment",
86
- "instanceof": "Function"
93
+ "$ref": "#/definitions/BannerFunction"
87
94
  },
88
95
  {
89
96
  "description": "The banner as string, it will be wrapped in a comment",
90
- "minLength": 1,
91
- "type": "string"
97
+ "type": "string",
98
+ "minLength": 1
92
99
  }
93
100
  ]
94
101
  }
@@ -1,30 +1,32 @@
1
1
  {
2
+ "title": "DllPluginOptions",
3
+ "type": "object",
2
4
  "additionalProperties": false,
3
- "required": ["path"],
4
5
  "properties": {
5
6
  "context": {
6
7
  "description": "Context of requests in the manifest file (defaults to the webpack context)",
7
- "minLength": 1,
8
- "type": "string"
8
+ "type": "string",
9
+ "minLength": 1
10
+ },
11
+ "entryOnly": {
12
+ "description": "If true, only entry points will be exposed",
13
+ "type": "boolean"
9
14
  },
10
15
  "name": {
11
16
  "description": "Name of the exposed dll function (external name, use value of 'output.library')",
12
- "minLength": 1,
13
- "type": "string"
14
- },
15
- "type": {
16
- "description": "Type of the dll bundle (external type, use value of 'output.libraryTarget')",
17
- "minLength": 1,
18
- "type": "string"
17
+ "type": "string",
18
+ "minLength": 1
19
19
  },
20
20
  "path": {
21
21
  "description": "Absolute path to the manifest json file (output)",
22
- "minLength": 1,
23
- "type": "string"
22
+ "type": "string",
23
+ "minLength": 1
24
24
  },
25
- "entryOnly": {
26
- "description": "If true, only entry points will be exposed",
27
- "type": "boolean"
25
+ "type": {
26
+ "description": "Type of the dll bundle (external type, use value of 'output.libraryTarget')",
27
+ "type": "string",
28
+ "minLength": 1
28
29
  }
29
- }
30
+ },
31
+ "required": ["path"]
30
32
  }
@@ -1,70 +1,83 @@
1
1
  {
2
- "additionalProperties": false,
3
- "anyOf": [
4
- {
5
- "required": ["manifest"]
6
- },
7
- {
8
- "required": ["content"]
9
- }
10
- ],
11
- "properties": {
12
- "context": {
13
- "description": "(absolute path) context of requests in the manifest (or content property)",
14
- "type": "string",
15
- "absolutePath": true
2
+ "definitions": {
3
+ "DllReferencePluginOptionsContent": {
4
+ "description": "The mappings from request to module info",
5
+ "type": "object",
6
+ "additionalProperties": {
7
+ "description": "Module info",
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "buildMeta": {
12
+ "description": "Meta information about the module",
13
+ "type": "object"
14
+ },
15
+ "exports": {
16
+ "description": "Information about the provided exports of the module",
17
+ "anyOf": [
18
+ {
19
+ "description": "Exports unknown/dynamic",
20
+ "enum": [true]
21
+ },
22
+ {
23
+ "description": "List of provided exports of the module",
24
+ "type": "array",
25
+ "items": {
26
+ "description": "Name of the export",
27
+ "type": "string",
28
+ "minLength": 1
29
+ }
30
+ }
31
+ ]
32
+ },
33
+ "id": {
34
+ "description": "Module ID",
35
+ "anyOf": [
36
+ {
37
+ "type": "number"
38
+ },
39
+ {
40
+ "type": "string",
41
+ "minLength": 1
42
+ }
43
+ ]
44
+ }
45
+ },
46
+ "required": ["id"]
47
+ },
48
+ "minProperties": 1
16
49
  },
17
- "manifest": {
18
- "description": "An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation",
19
- "oneOf": [
20
- {
21
- "type": "object",
22
- "additionalProperties": false,
23
- "properties": {
24
- "content": {
25
- "description": "The mappings from request to module id",
26
- "minLength": 1,
27
- "type": "object"
28
- },
29
- "name": {
30
- "description": "The name where the dll is exposed (external name)",
31
- "minLength": 1,
32
- "type": "string"
33
- },
34
- "type": {
35
- "description": "The type how the dll is exposed (external type)",
36
- "minLength": 1,
37
- "type": "string"
50
+ "DllReferencePluginOptionsManifest": {
51
+ "description": "An object containing content, name and type",
52
+ "type": "object",
53
+ "additionalProperties": false,
54
+ "properties": {
55
+ "content": {
56
+ "description": "The mappings from request to module info",
57
+ "anyOf": [
58
+ {
59
+ "$ref": "#/definitions/DllReferencePluginOptionsContent"
38
60
  }
39
- }
61
+ ]
40
62
  },
41
- {
63
+ "name": {
64
+ "description": "The name where the dll is exposed (external name)",
42
65
  "type": "string",
43
- "absolutePath": true
66
+ "minLength": 1
67
+ },
68
+ "type": {
69
+ "description": "The type how the dll is exposed (external type)",
70
+ "anyOf": [
71
+ {
72
+ "$ref": "#/definitions/DllReferencePluginOptionsSourceType"
73
+ }
74
+ ]
44
75
  }
45
- ]
46
- },
47
- "content": {
48
- "description": "The mappings from request to module id (defaults to manifest.content)",
49
- "minLength": 1,
50
- "type": "object"
51
- },
52
- "name": {
53
- "description": "The name where the dll is exposed (external name, defaults to manifest.name)",
54
- "minLength": 1,
55
- "type": "string"
56
- },
57
- "type": {
58
- "description": "The way how the export of the dll bundle is used",
59
- "enum": ["require", "object"]
60
- },
61
- "scope": {
62
- "description": "Prefix which is used for accessing the content of the dll",
63
- "minLength": 1,
64
- "type": "string"
76
+ },
77
+ "required": ["content"]
65
78
  },
66
- "sourceType": {
67
- "description": "How the dll is exposed (libraryTarget, defaults to manifest.type)",
79
+ "DllReferencePluginOptionsSourceType": {
80
+ "description": "The type how the dll is exposed (external type)",
68
81
  "enum": [
69
82
  "var",
70
83
  "assign",
@@ -79,14 +92,113 @@
79
92
  "umd2",
80
93
  "jsonp"
81
94
  ]
95
+ }
96
+ },
97
+ "title": "DllReferencePluginOptions",
98
+ "anyOf": [
99
+ {
100
+ "type": "object",
101
+ "additionalProperties": false,
102
+ "properties": {
103
+ "context": {
104
+ "description": "(absolute path) context of requests in the manifest (or content property)",
105
+ "type": "string",
106
+ "absolutePath": true
107
+ },
108
+ "extensions": {
109
+ "description": "Extensions used to resolve modules in the dll bundle (only used when using 'scope')",
110
+ "type": "array",
111
+ "items": {
112
+ "description": "An extension",
113
+ "type": "string"
114
+ }
115
+ },
116
+ "manifest": {
117
+ "description": "An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation",
118
+ "oneOf": [
119
+ {
120
+ "$ref": "#/definitions/DllReferencePluginOptionsManifest"
121
+ },
122
+ {
123
+ "type": "string",
124
+ "absolutePath": true
125
+ }
126
+ ]
127
+ },
128
+ "name": {
129
+ "description": "The name where the dll is exposed (external name, defaults to manifest.name)",
130
+ "type": "string",
131
+ "minLength": 1
132
+ },
133
+ "scope": {
134
+ "description": "Prefix which is used for accessing the content of the dll",
135
+ "type": "string",
136
+ "minLength": 1
137
+ },
138
+ "sourceType": {
139
+ "description": "How the dll is exposed (libraryTarget, defaults to manifest.type)",
140
+ "anyOf": [
141
+ {
142
+ "$ref": "#/definitions/DllReferencePluginOptionsSourceType"
143
+ }
144
+ ]
145
+ },
146
+ "type": {
147
+ "description": "The way how the export of the dll bundle is used",
148
+ "enum": ["require", "object"]
149
+ }
150
+ },
151
+ "required": ["manifest"]
82
152
  },
83
- "extensions": {
84
- "description": "Extensions used to resolve modules in the dll bundle (only used when using 'scope')",
85
- "type": "array",
86
- "items": {
87
- "description": "An extension",
88
- "type": "string"
89
- }
153
+ {
154
+ "type": "object",
155
+ "additionalProperties": false,
156
+ "properties": {
157
+ "content": {
158
+ "description": "The mappings from request to module info",
159
+ "anyOf": [
160
+ {
161
+ "$ref": "#/definitions/DllReferencePluginOptionsContent"
162
+ }
163
+ ]
164
+ },
165
+ "context": {
166
+ "description": "(absolute path) context of requests in the manifest (or content property)",
167
+ "type": "string",
168
+ "absolutePath": true
169
+ },
170
+ "extensions": {
171
+ "description": "Extensions used to resolve modules in the dll bundle (only used when using 'scope')",
172
+ "type": "array",
173
+ "items": {
174
+ "description": "An extension",
175
+ "type": "string"
176
+ }
177
+ },
178
+ "name": {
179
+ "description": "The name where the dll is exposed (external name)",
180
+ "type": "string",
181
+ "minLength": 1
182
+ },
183
+ "scope": {
184
+ "description": "Prefix which is used for accessing the content of the dll",
185
+ "type": "string",
186
+ "minLength": 1
187
+ },
188
+ "sourceType": {
189
+ "description": "How the dll is exposed (libraryTarget)",
190
+ "anyOf": [
191
+ {
192
+ "$ref": "#/definitions/DllReferencePluginOptionsSourceType"
193
+ }
194
+ ]
195
+ },
196
+ "type": {
197
+ "description": "The way how the export of the dll bundle is used",
198
+ "enum": ["require", "object"]
199
+ }
200
+ },
201
+ "required": ["content", "name"]
90
202
  }
91
- }
203
+ ]
92
204
  }
@@ -1,11 +1,12 @@
1
1
  {
2
+ "title": "HashedModuleIdsPluginOptions",
2
3
  "type": "object",
3
4
  "additionalProperties": false,
4
5
  "properties": {
5
- "hashFunction": {
6
- "description": "The hashing algorithm to use, defaults to 'md5'. All functions from Node.JS' crypto.createHash are supported.",
6
+ "context": {
7
+ "description": "The context directory for creating names.",
7
8
  "type": "string",
8
- "minLength": 1
9
+ "absolutePath": true
9
10
  },
10
11
  "hashDigest": {
11
12
  "description": "The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported.",
@@ -15,6 +16,11 @@
15
16
  "description": "The prefix length of the hash digest to use, defaults to 4.",
16
17
  "type": "number",
17
18
  "minimum": 1
19
+ },
20
+ "hashFunction": {
21
+ "description": "The hashing algorithm to use, defaults to 'md5'. All functions from Node.JS' crypto.createHash are supported.",
22
+ "type": "string",
23
+ "minLength": 1
18
24
  }
19
25
  }
20
26
  }
@@ -1,29 +1,35 @@
1
1
  {
2
- "type": "object",
2
+ "title": "IgnorePluginOptions",
3
3
  "oneOf": [
4
4
  {
5
+ "type": "object",
5
6
  "additionalProperties": false,
6
7
  "properties": {
7
- "resourceRegExp": {
8
- "description": "A RegExp to test the request against",
9
- "instanceof": "RegExp"
10
- },
11
8
  "contextRegExp": {
12
9
  "description": "A RegExp to test the context (directory) against",
13
- "instanceof": "RegExp"
10
+ "instanceof": "RegExp",
11
+ "tsType": "RegExp"
12
+ },
13
+ "resourceRegExp": {
14
+ "description": "A RegExp to test the request against",
15
+ "instanceof": "RegExp",
16
+ "tsType": "RegExp"
14
17
  }
15
18
  }
16
19
  },
17
20
  {
21
+ "type": "object",
18
22
  "additionalProperties": false,
19
23
  "properties": {
20
- "checkResource": {
21
- "description": "A filter function for resource",
22
- "instanceof": "Function"
23
- },
24
24
  "checkContext": {
25
25
  "description": "A filter function for context",
26
- "instanceof": "Function"
26
+ "instanceof": "Function",
27
+ "tsType": "((context: string) => boolean)"
28
+ },
29
+ "checkResource": {
30
+ "description": "A filter function for resource",
31
+ "instanceof": "Function",
32
+ "tsType": "((resource: string) => boolean)"
27
33
  }
28
34
  }
29
35
  }
@@ -1,26 +1,27 @@
1
- {
2
- "type": "object",
3
- "additionalProperties": true,
4
- "properties": {
5
- "debug": {
6
- "description": "Whether loaders should be in debug mode or not. debug will be removed as of webpack 3",
7
- "type": "boolean"
8
- },
9
- "minimize": {
10
- "description": "Where loaders can be switched to minimize mode",
11
- "type": "boolean"
12
- },
13
- "options": {
14
- "description": "A configuration object that can be used to configure older loaders",
15
- "type": "object",
16
- "additionalProperties": true,
17
- "properties": {
18
- "context": {
19
- "description": "The context that can be used to configure older loaders",
20
- "type": "string",
21
- "absolutePath": true
22
- }
23
- }
24
- }
25
- }
26
- }
1
+ {
2
+ "title": "LoaderOptionsPluginOptions",
3
+ "type": "object",
4
+ "additionalProperties": true,
5
+ "properties": {
6
+ "debug": {
7
+ "description": "Whether loaders should be in debug mode or not. debug will be removed as of webpack 3",
8
+ "type": "boolean"
9
+ },
10
+ "minimize": {
11
+ "description": "Where loaders can be switched to minimize mode",
12
+ "type": "boolean"
13
+ },
14
+ "options": {
15
+ "description": "A configuration object that can be used to configure older loaders",
16
+ "type": "object",
17
+ "additionalProperties": true,
18
+ "properties": {
19
+ "context": {
20
+ "description": "The context that can be used to configure older loaders",
21
+ "type": "string",
22
+ "absolutePath": true
23
+ }
24
+ }
25
+ }
26
+ }
27
+ }