webpack 4.1.0 → 4.4.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.
Files changed (118) hide show
  1. package/README.md +719 -721
  2. package/bin/webpack.js +69 -10
  3. package/lib/APIPlugin.js +84 -84
  4. package/lib/AmdMainTemplatePlugin.js +75 -77
  5. package/lib/AsyncDependencyToInitialChunkError.js +21 -23
  6. package/lib/BannerPlugin.js +101 -101
  7. package/lib/Chunk.js +477 -469
  8. package/lib/ChunkTemplate.js +51 -53
  9. package/lib/Compilation.js +1858 -1851
  10. package/lib/Compiler.js +493 -478
  11. package/lib/ConcurrentCompilationError.js +19 -0
  12. package/lib/ContextModule.js +696 -685
  13. package/lib/ContextModuleFactory.js +245 -243
  14. package/lib/DefinePlugin.js +197 -197
  15. package/lib/DelegatedModule.js +101 -101
  16. package/lib/DependenciesBlockVariable.js +51 -52
  17. package/lib/Dependency.js +53 -52
  18. package/lib/DllModule.js +54 -54
  19. package/lib/DllModuleFactory.js +29 -29
  20. package/lib/EnvironmentPlugin.js +65 -67
  21. package/lib/EvalDevToolModuleTemplatePlugin.js +60 -60
  22. package/lib/EvalSourceMapDevToolModuleTemplatePlugin.js +105 -105
  23. package/lib/ExportPropertyMainTemplatePlugin.js +40 -40
  24. package/lib/ExternalModule.js +159 -159
  25. package/lib/FunctionModuleTemplatePlugin.js +98 -98
  26. package/lib/HotModuleReplacement.runtime.js +631 -631
  27. package/lib/HotModuleReplacementPlugin.js +407 -406
  28. package/lib/HotUpdateChunkTemplate.js +78 -80
  29. package/lib/JavascriptGenerator.js +228 -229
  30. package/lib/JavascriptModulesPlugin.js +184 -158
  31. package/lib/JsonGenerator.js +42 -42
  32. package/lib/MainTemplate.js +406 -402
  33. package/lib/Module.js +343 -340
  34. package/lib/ModuleBuildError.js +42 -42
  35. package/lib/ModuleError.js +28 -28
  36. package/lib/ModuleFilenameHelpers.js +166 -166
  37. package/lib/ModuleTemplate.js +77 -79
  38. package/lib/ModuleWarning.js +30 -30
  39. package/lib/MultiCompiler.js +271 -259
  40. package/lib/MultiModule.js +78 -75
  41. package/lib/MultiModuleFactory.js +23 -23
  42. package/lib/MultiWatching.js +38 -37
  43. package/lib/NoModeWarning.js +23 -21
  44. package/lib/NormalModule.js +478 -470
  45. package/lib/NormalModuleFactory.js +483 -481
  46. package/lib/OptionsDefaulter.js +80 -86
  47. package/lib/Parser.js +2074 -2071
  48. package/lib/ProgressPlugin.js +231 -231
  49. package/lib/RawModule.js +54 -55
  50. package/lib/RecordIdsPlugin.js +160 -160
  51. package/lib/RemovedPluginError.js +13 -13
  52. package/lib/ResolverFactory.js +64 -67
  53. package/lib/RuntimeTemplate.js +267 -297
  54. package/lib/SetVarMainTemplatePlugin.js +57 -57
  55. package/lib/SourceMapDevToolPlugin.js +302 -308
  56. package/lib/Stats.js +1234 -1212
  57. package/lib/Template.js +205 -205
  58. package/lib/TemplatedPathPlugin.js +170 -143
  59. package/lib/UmdMainTemplatePlugin.js +264 -269
  60. package/lib/Watching.js +193 -193
  61. package/lib/WebAssemblyParser.js +50 -54
  62. package/lib/WebpackOptionsApply.js +401 -401
  63. package/lib/WebpackOptionsDefaulter.js +337 -317
  64. package/lib/WebpackOptionsValidationError.js +316 -319
  65. package/lib/debug/ProfilingPlugin.js +409 -405
  66. package/lib/dependencies/AMDDefineDependencyParserPlugin.js +328 -311
  67. package/lib/dependencies/AMDRequireContextDependency.js +20 -20
  68. package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +270 -241
  69. package/lib/dependencies/HarmonyAcceptImportDependency.js +23 -23
  70. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +620 -606
  71. package/lib/dependencies/HarmonyExportSpecifierDependency.js +53 -53
  72. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +214 -214
  73. package/lib/dependencies/HarmonyImportSpecifierDependency.js +154 -156
  74. package/lib/dependencies/ImportDependenciesBlock.js +17 -17
  75. package/lib/dependencies/ImportDependency.js +34 -34
  76. package/lib/dependencies/ImportEagerDependency.js +32 -32
  77. package/lib/dependencies/ImportParserPlugin.js +175 -179
  78. package/lib/dependencies/ImportWeakDependency.js +34 -34
  79. package/lib/dependencies/JsonExportsDependency.js +25 -25
  80. package/lib/dependencies/ModuleDependency.js +20 -20
  81. package/lib/dependencies/NullDependency.js +20 -20
  82. package/lib/dependencies/RequireContextDependency.js +22 -22
  83. package/lib/dependencies/RequireIncludeDependency.js +40 -40
  84. package/lib/dependencies/WebpackMissingModule.js +20 -22
  85. package/lib/node/NodeChunkTemplatePlugin.js +31 -31
  86. package/lib/node/NodeHotUpdateChunkTemplatePlugin.js +36 -36
  87. package/lib/node/NodeMainTemplatePlugin.js +320 -273
  88. package/lib/node/ReadFileCompileWasmMainTemplatePlugin.js +113 -115
  89. package/lib/optimize/AggressiveSplittingPlugin.js +281 -281
  90. package/lib/optimize/ConcatenatedModule.js +1364 -1366
  91. package/lib/optimize/RemoveParentModulesPlugin.js +114 -114
  92. package/lib/optimize/SplitChunksPlugin.js +519 -491
  93. package/lib/performance/SizeLimitsPlugin.js +105 -105
  94. package/lib/util/TrackingSet.js +35 -35
  95. package/lib/util/objectToMap.js +10 -10
  96. package/lib/wasm/WasmModuleTemplatePlugin.js +106 -106
  97. package/lib/web/JsonpChunkTemplatePlugin.js +47 -47
  98. package/lib/web/JsonpExportMainTemplatePlugin.js +47 -47
  99. package/lib/web/JsonpHotUpdateChunkTemplatePlugin.js +39 -39
  100. package/lib/web/JsonpMainTemplatePlugin.js +425 -403
  101. package/lib/webpack.js +182 -179
  102. package/lib/webworker/WebWorkerChunkTemplatePlugin.js +35 -35
  103. package/lib/webworker/WebWorkerHotUpdateChunkTemplatePlugin.js +40 -40
  104. package/lib/webworker/WebWorkerMainTemplatePlugin.js +177 -154
  105. package/package.json +9 -8
  106. package/schemas/WebpackOptions.json +1973 -1951
  107. package/schemas/ajv.absolutePath.js +55 -29
  108. package/schemas/plugins/BannerPlugin.json +85 -85
  109. package/schemas/plugins/DllPlugin.json +28 -28
  110. package/schemas/plugins/DllReferencePlugin.json +99 -99
  111. package/schemas/plugins/HashedModuleIdsPlugin.json +24 -24
  112. package/schemas/plugins/LoaderOptionsPlugin.json +26 -26
  113. package/schemas/plugins/SourceMapDevToolPlugin.json +187 -187
  114. package/schemas/plugins/WatchIgnorePlugin.json +16 -16
  115. package/schemas/plugins/debug/ProfilingPlugin.json +12 -12
  116. package/schemas/plugins/optimize/AggressiveSplittingPlugin.json +22 -22
  117. package/schemas/plugins/optimize/LimitChunkCountPlugin.json +15 -15
  118. package/schemas/plugins/optimize/MinChunkSizePlugin.json +13 -13
@@ -1,187 +1,187 @@
1
- {
2
- "type": "object",
3
- "additionalProperties": false,
4
- "definitions": {
5
- "rule": {
6
- "oneOf": [
7
- {
8
- "instanceof": "RegExp"
9
- },
10
- {
11
- "minLength": 1,
12
- "type": "string"
13
- }
14
- ]
15
- },
16
- "rules": {
17
- "oneOf": [
18
- {
19
- "items": {
20
- "description": "A rule condition",
21
- "anyOf": [
22
- {
23
- "$ref": "#/definitions/rule"
24
- }
25
- ]
26
- },
27
- "type": "array"
28
- },
29
- {
30
- "$ref": "#/definitions/rule"
31
- }
32
- ]
33
- }
34
- },
35
- "properties": {
36
- "test": {
37
- "description": "Include source maps for modules based on their extension (defaults to .js and .css)",
38
- "anyOf": [
39
- {
40
- "$ref": "#/definitions/rules"
41
- }
42
- ]
43
- },
44
- "include": {
45
- "description": "Include source maps for module paths that match the given value",
46
- "anyOf": [
47
- {
48
- "$ref": "#/definitions/rules"
49
- }
50
- ]
51
- },
52
- "exclude": {
53
- "description": "Exclude modules that match the given value from source map generation",
54
- "anyOf": [
55
- {
56
- "$ref": "#/definitions/rules"
57
- }
58
- ]
59
- },
60
- "filename": {
61
- "description": "Defines the output filename of the SourceMap (will be inlined if no value is provided)",
62
- "oneOf": [
63
- {
64
- "description": "Disable separate SourceMap file and inline SourceMap as DataUrl",
65
- "enum": [
66
- false,
67
- null
68
- ]
69
- },
70
- {
71
- "type": "string",
72
- "minLength": 1,
73
- "absolutePath": false
74
- }
75
- ]
76
- },
77
- "append": {
78
- "description": "Appends the given value to the original asset. Usually the #sourceMappingURL comment. [url] is replaced with a URL to the source map file. false disables the appending",
79
- "oneOf": [
80
- {
81
- "description": "Append no SourceMap comment to the bundle, but still generate SourceMaps",
82
- "enum": [
83
- false,
84
- null
85
- ]
86
- },
87
- {
88
- "minLength": 1,
89
- "type": "string"
90
- }
91
- ]
92
- },
93
- "moduleFilenameTemplate": {
94
- "description": "Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap",
95
- "oneOf": [
96
- {
97
- "description": "Custom function generating the identifer",
98
- "instanceof": "Function"
99
- },
100
- {
101
- "minLength": 1,
102
- "type": "string"
103
- }
104
- ]
105
- },
106
- "fallbackModuleFilenameTemplate": {
107
- "description": "Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap used only if 'moduleFilenameTemplate' would result in a conflict",
108
- "oneOf": [
109
- {
110
- "description": "Custom function generating the identifer",
111
- "instanceof": "Function"
112
- },
113
- {
114
- "minLength": 1,
115
- "type": "string"
116
- }
117
- ]
118
- },
119
- "namespace": {
120
- "description": "Namespace prefix to allow multiple webpack roots in the devtools",
121
- "type": "string"
122
- },
123
- "module": {
124
- "description": "Indicates whether SourceMaps from loaders should be used (defaults to true)",
125
- "type": "boolean"
126
- },
127
- "columns": {
128
- "description": "Indicates whether column mappings should be used (defaults to true)",
129
- "type": "boolean"
130
- },
131
- "noSources": {
132
- "description": "Omit the 'sourceContents' array from the SourceMap",
133
- "type": "boolean"
134
- },
135
- "sourceRoot": {
136
- "description": "Provide a custom value for the 'sourceRoot' property in the SourceMap",
137
- "type": "string"
138
- },
139
- "publicPath": {
140
- "description": "Provide a custom public path for the SourceMapping comment",
141
- "type": "string"
142
- },
143
- "fileContext": {
144
- "description": "Path prefix to which the [file] placeholder is relative to",
145
- "type": "string"
146
- },
147
- "lineToLine": {
148
- "description": "(deprecated) try to map original files line to line to generated files",
149
- "anyOf": [
150
- {
151
- "type": "boolean"
152
- },
153
- {
154
- "description": "Simplify and speed up source mapping by using line to line source mappings for matched modules",
155
- "type": "object",
156
- "additionalProperties": false,
157
- "properties": {
158
- "test": {
159
- "description": "Include source maps for modules based on their extension (defaults to .js and .css)",
160
- "anyOf": [
161
- {
162
- "$ref": "#/definitions/rules"
163
- }
164
- ]
165
- },
166
- "include": {
167
- "description": "Include source maps for module paths that match the given value",
168
- "anyOf": [
169
- {
170
- "$ref": "#/definitions/rules"
171
- }
172
- ]
173
- },
174
- "exclude": {
175
- "description": "Exclude modules that match the given value from source map generation",
176
- "anyOf": [
177
- {
178
- "$ref": "#/definitions/rules"
179
- }
180
- ]
181
- }
182
- }
183
- }
184
- ]
185
- }
186
- }
187
- }
1
+ {
2
+ "type": "object",
3
+ "additionalProperties": false,
4
+ "definitions": {
5
+ "rule": {
6
+ "oneOf": [
7
+ {
8
+ "instanceof": "RegExp"
9
+ },
10
+ {
11
+ "minLength": 1,
12
+ "type": "string"
13
+ }
14
+ ]
15
+ },
16
+ "rules": {
17
+ "oneOf": [
18
+ {
19
+ "items": {
20
+ "description": "A rule condition",
21
+ "anyOf": [
22
+ {
23
+ "$ref": "#/definitions/rule"
24
+ }
25
+ ]
26
+ },
27
+ "type": "array"
28
+ },
29
+ {
30
+ "$ref": "#/definitions/rule"
31
+ }
32
+ ]
33
+ }
34
+ },
35
+ "properties": {
36
+ "test": {
37
+ "description": "Include source maps for modules based on their extension (defaults to .js and .css)",
38
+ "anyOf": [
39
+ {
40
+ "$ref": "#/definitions/rules"
41
+ }
42
+ ]
43
+ },
44
+ "include": {
45
+ "description": "Include source maps for module paths that match the given value",
46
+ "anyOf": [
47
+ {
48
+ "$ref": "#/definitions/rules"
49
+ }
50
+ ]
51
+ },
52
+ "exclude": {
53
+ "description": "Exclude modules that match the given value from source map generation",
54
+ "anyOf": [
55
+ {
56
+ "$ref": "#/definitions/rules"
57
+ }
58
+ ]
59
+ },
60
+ "filename": {
61
+ "description": "Defines the output filename of the SourceMap (will be inlined if no value is provided)",
62
+ "oneOf": [
63
+ {
64
+ "description": "Disable separate SourceMap file and inline SourceMap as DataUrl",
65
+ "enum": [
66
+ false,
67
+ null
68
+ ]
69
+ },
70
+ {
71
+ "type": "string",
72
+ "minLength": 1,
73
+ "absolutePath": false
74
+ }
75
+ ]
76
+ },
77
+ "append": {
78
+ "description": "Appends the given value to the original asset. Usually the #sourceMappingURL comment. [url] is replaced with a URL to the source map file. false disables the appending",
79
+ "oneOf": [
80
+ {
81
+ "description": "Append no SourceMap comment to the bundle, but still generate SourceMaps",
82
+ "enum": [
83
+ false,
84
+ null
85
+ ]
86
+ },
87
+ {
88
+ "minLength": 1,
89
+ "type": "string"
90
+ }
91
+ ]
92
+ },
93
+ "moduleFilenameTemplate": {
94
+ "description": "Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap",
95
+ "oneOf": [
96
+ {
97
+ "description": "Custom function generating the identifer",
98
+ "instanceof": "Function"
99
+ },
100
+ {
101
+ "minLength": 1,
102
+ "type": "string"
103
+ }
104
+ ]
105
+ },
106
+ "fallbackModuleFilenameTemplate": {
107
+ "description": "Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap used only if 'moduleFilenameTemplate' would result in a conflict",
108
+ "oneOf": [
109
+ {
110
+ "description": "Custom function generating the identifer",
111
+ "instanceof": "Function"
112
+ },
113
+ {
114
+ "minLength": 1,
115
+ "type": "string"
116
+ }
117
+ ]
118
+ },
119
+ "namespace": {
120
+ "description": "Namespace prefix to allow multiple webpack roots in the devtools",
121
+ "type": "string"
122
+ },
123
+ "module": {
124
+ "description": "Indicates whether SourceMaps from loaders should be used (defaults to true)",
125
+ "type": "boolean"
126
+ },
127
+ "columns": {
128
+ "description": "Indicates whether column mappings should be used (defaults to true)",
129
+ "type": "boolean"
130
+ },
131
+ "noSources": {
132
+ "description": "Omit the 'sourceContents' array from the SourceMap",
133
+ "type": "boolean"
134
+ },
135
+ "sourceRoot": {
136
+ "description": "Provide a custom value for the 'sourceRoot' property in the SourceMap",
137
+ "type": "string"
138
+ },
139
+ "publicPath": {
140
+ "description": "Provide a custom public path for the SourceMapping comment",
141
+ "type": "string"
142
+ },
143
+ "fileContext": {
144
+ "description": "Path prefix to which the [file] placeholder is relative to",
145
+ "type": "string"
146
+ },
147
+ "lineToLine": {
148
+ "description": "(deprecated) try to map original files line to line to generated files",
149
+ "anyOf": [
150
+ {
151
+ "type": "boolean"
152
+ },
153
+ {
154
+ "description": "Simplify and speed up source mapping by using line to line source mappings for matched modules",
155
+ "type": "object",
156
+ "additionalProperties": false,
157
+ "properties": {
158
+ "test": {
159
+ "description": "Include source maps for modules based on their extension (defaults to .js and .css)",
160
+ "anyOf": [
161
+ {
162
+ "$ref": "#/definitions/rules"
163
+ }
164
+ ]
165
+ },
166
+ "include": {
167
+ "description": "Include source maps for module paths that match the given value",
168
+ "anyOf": [
169
+ {
170
+ "$ref": "#/definitions/rules"
171
+ }
172
+ ]
173
+ },
174
+ "exclude": {
175
+ "description": "Exclude modules that match the given value from source map generation",
176
+ "anyOf": [
177
+ {
178
+ "$ref": "#/definitions/rules"
179
+ }
180
+ ]
181
+ }
182
+ }
183
+ }
184
+ ]
185
+ }
186
+ }
187
+ }
@@ -1,16 +1,16 @@
1
- {
2
- "description": "A list of RegExps or absolute paths to directories or files that should be ignored",
3
- "type": "array",
4
- "items": {
5
- "description": "RegExp or absolute path to directories or files that should be ignored",
6
- "oneOf": [
7
- {
8
- "type": "string"
9
- },
10
- {
11
- "instanceof": "RegExp"
12
- }
13
- ]
14
- },
15
- "minItems": 1
16
- }
1
+ {
2
+ "description": "A list of RegExps or absolute paths to directories or files that should be ignored",
3
+ "type": "array",
4
+ "items": {
5
+ "description": "RegExp or absolute path to directories or files that should be ignored",
6
+ "oneOf": [
7
+ {
8
+ "type": "string"
9
+ },
10
+ {
11
+ "instanceof": "RegExp"
12
+ }
13
+ ]
14
+ },
15
+ "minItems": 1
16
+ }
@@ -1,12 +1,12 @@
1
- {
2
- "type": "object",
3
- "additionalProperties": false,
4
- "properties": {
5
- "outputPath": {
6
- "description": "Path to the output file e.g. `profiling/events.json`. Defaults to `events.json`.",
7
- "type": "string",
8
- "absolutePath": false,
9
- "minLength": 4
10
- }
11
- }
12
- }
1
+ {
2
+ "type": "object",
3
+ "additionalProperties": false,
4
+ "properties": {
5
+ "outputPath": {
6
+ "description": "Path to the output file e.g. `profiling/events.json`. Defaults to `events.json`.",
7
+ "type": "string",
8
+ "absolutePath": false,
9
+ "minLength": 4
10
+ }
11
+ }
12
+ }
@@ -1,22 +1,22 @@
1
- {
2
- "type": "object",
3
- "additionalProperties": false,
4
- "properties": {
5
- "minSize": {
6
- "description": "Byte, split point. Default: 30720",
7
- "type": "number"
8
- },
9
- "maxSize": {
10
- "description": "Byte, maxsize of per file. Default: 51200",
11
- "type": "number"
12
- },
13
- "chunkOverhead": {
14
- "description": "Default: 0",
15
- "type": "number"
16
- },
17
- "entryChunkMultiplicator": {
18
- "description": "Default: 1",
19
- "type": "number"
20
- }
21
- }
22
- }
1
+ {
2
+ "type": "object",
3
+ "additionalProperties": false,
4
+ "properties": {
5
+ "minSize": {
6
+ "description": "Byte, split point. Default: 30720",
7
+ "type": "number"
8
+ },
9
+ "maxSize": {
10
+ "description": "Byte, maxsize of per file. Default: 51200",
11
+ "type": "number"
12
+ },
13
+ "chunkOverhead": {
14
+ "description": "Default: 0",
15
+ "type": "number"
16
+ },
17
+ "entryChunkMultiplicator": {
18
+ "description": "Default: 1",
19
+ "type": "number"
20
+ }
21
+ }
22
+ }
@@ -1,15 +1,15 @@
1
- {
2
- "type": "object",
3
- "additionalProperties": false,
4
- "properties": {
5
- "maxChunks": {
6
- "description": "Limit the maximum number of chunks using a value greater greater than or equal to 1",
7
- "type": "number",
8
- "minimum": 1
9
- },
10
- "minChunkSize": {
11
- "description": "Set a minimum chunk size",
12
- "type": "number"
13
- }
14
- }
15
- }
1
+ {
2
+ "type": "object",
3
+ "additionalProperties": false,
4
+ "properties": {
5
+ "maxChunks": {
6
+ "description": "Limit the maximum number of chunks using a value greater greater than or equal to 1",
7
+ "type": "number",
8
+ "minimum": 1
9
+ },
10
+ "minChunkSize": {
11
+ "description": "Set a minimum chunk size",
12
+ "type": "number"
13
+ }
14
+ }
15
+ }
@@ -1,13 +1,13 @@
1
- {
2
- "additionalProperties": false,
3
- "type": "object",
4
- "required": [
5
- "minChunkSize"
6
- ],
7
- "properties": {
8
- "minChunkSize": {
9
- "description": "Minimum number of characters",
10
- "type": "number"
11
- }
12
- }
13
- }
1
+ {
2
+ "additionalProperties": false,
3
+ "type": "object",
4
+ "required": [
5
+ "minChunkSize"
6
+ ],
7
+ "properties": {
8
+ "minChunkSize": {
9
+ "description": "Minimum number of characters",
10
+ "type": "number"
11
+ }
12
+ }
13
+ }