webpack 3.6.0 → 3.8.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.
Files changed (229) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +716 -716
  3. package/bin/convert-argv.js +1 -1
  4. package/bin/webpack.js +6 -0
  5. package/buildin/.eslintrc +7 -7
  6. package/buildin/amd-define.js +3 -3
  7. package/buildin/amd-options.js +2 -2
  8. package/buildin/global.js +21 -21
  9. package/buildin/harmony-module.js +24 -24
  10. package/buildin/module.js +22 -22
  11. package/buildin/system.js +7 -7
  12. package/hot/.eslintrc +9 -9
  13. package/hot/dev-server.js +53 -53
  14. package/hot/emitter.js +2 -2
  15. package/hot/log-apply-result.js +38 -38
  16. package/hot/log.js +44 -44
  17. package/hot/only-dev-server.js +71 -71
  18. package/hot/poll.js +34 -34
  19. package/hot/signal.js +51 -51
  20. package/lib/APIPlugin.js +45 -45
  21. package/lib/AsyncDependenciesBlock.js +43 -43
  22. package/lib/AsyncDependencyToInitialChunkWarning.js +21 -0
  23. package/lib/AutomaticPrefetchPlugin.js +36 -36
  24. package/lib/BasicEvaluatedExpression.js +203 -203
  25. package/lib/CaseSensitiveModulesWarning.js +49 -49
  26. package/lib/Chunk.js +3 -0
  27. package/lib/ChunkRenderError.js +24 -24
  28. package/lib/ChunkTemplate.js +36 -36
  29. package/lib/CompatibilityPlugin.js +57 -57
  30. package/lib/Compilation.js +158 -51
  31. package/lib/Compiler.js +523 -523
  32. package/lib/ConstPlugin.js +60 -60
  33. package/lib/ContextExclusionPlugin.js +17 -0
  34. package/lib/ContextModule.js +431 -431
  35. package/lib/ContextModuleFactory.js +14 -5
  36. package/lib/ContextReplacementPlugin.js +111 -111
  37. package/lib/DefinePlugin.js +123 -123
  38. package/lib/DelegatedModule.js +98 -92
  39. package/lib/DelegatedModuleFactoryPlugin.js +59 -59
  40. package/lib/DelegatedPlugin.js +30 -30
  41. package/lib/DependenciesBlockVariable.js +51 -51
  42. package/lib/DllEntryPlugin.js +37 -37
  43. package/lib/DllModule.js +58 -58
  44. package/lib/DllModuleFactory.js +20 -20
  45. package/lib/DllPlugin.js +38 -38
  46. package/lib/DllReferencePlugin.js +62 -62
  47. package/lib/DynamicEntryPlugin.js +59 -59
  48. package/lib/EntryModuleNotFoundError.js +22 -22
  49. package/lib/EntryOptionPlugin.js +31 -31
  50. package/lib/EnvironmentPlugin.js +50 -50
  51. package/lib/ErrorHelpers.js +31 -31
  52. package/lib/EvalDevToolModulePlugin.js +22 -22
  53. package/lib/EvalDevToolModuleTemplatePlugin.js +33 -33
  54. package/lib/EvalSourceMapDevToolModuleTemplatePlugin.js +75 -75
  55. package/lib/EvalSourceMapDevToolPlugin.js +32 -32
  56. package/lib/ExportPropertyMainTemplatePlugin.js +31 -31
  57. package/lib/ExtendedAPIPlugin.js +47 -47
  58. package/lib/ExternalModule.js +7 -0
  59. package/lib/ExternalModuleFactoryPlugin.js +91 -91
  60. package/lib/ExternalsPlugin.js +21 -21
  61. package/lib/FlagDependencyExportsPlugin.js +101 -101
  62. package/lib/FunctionModulePlugin.js +24 -24
  63. package/lib/FunctionModuleTemplatePlugin.js +7 -3
  64. package/lib/HashedModuleIdsPlugin.js +42 -42
  65. package/lib/HotUpdateChunkTemplate.js +31 -31
  66. package/lib/IgnorePlugin.js +69 -69
  67. package/lib/JsonpExportMainTemplatePlugin.js +37 -37
  68. package/lib/JsonpHotUpdateChunkTemplatePlugin.js +27 -27
  69. package/lib/JsonpMainTemplate.runtime.js +2 -1
  70. package/lib/JsonpMainTemplatePlugin.js +2 -0
  71. package/lib/JsonpTemplatePlugin.js +21 -21
  72. package/lib/LibManifestPlugin.js +63 -63
  73. package/lib/LibraryTemplatePlugin.js +92 -92
  74. package/lib/LoaderOptionsPlugin.js +36 -36
  75. package/lib/LoaderTargetPlugin.js +19 -19
  76. package/lib/MemoryOutputFileSystem.js +5 -5
  77. package/lib/ModuleBuildError.js +42 -42
  78. package/lib/ModuleDependencyError.js +22 -22
  79. package/lib/ModuleDependencyWarning.js +22 -22
  80. package/lib/ModuleError.js +24 -24
  81. package/lib/ModuleFilenameHelpers.js +162 -162
  82. package/lib/ModuleNotFoundError.js +26 -26
  83. package/lib/ModuleParseError.js +1 -1
  84. package/lib/ModuleReason.js +50 -50
  85. package/lib/ModuleTemplate.js +23 -23
  86. package/lib/ModuleWarning.js +24 -24
  87. package/lib/MovedToPluginWarningPlugin.js +21 -21
  88. package/lib/MultiCompiler.js +164 -164
  89. package/lib/MultiEntryPlugin.js +39 -39
  90. package/lib/MultiModuleFactory.js +19 -19
  91. package/lib/MultiStats.js +79 -79
  92. package/lib/MultiWatching.js +32 -32
  93. package/lib/NamedChunksPlugin.js +30 -30
  94. package/lib/NamedModulesPlugin.js +27 -27
  95. package/lib/NewWatchingPlugin.js +15 -15
  96. package/lib/NoEmitOnErrorsPlugin.js +22 -22
  97. package/lib/NoErrorsPlugin.js +29 -29
  98. package/lib/NodeStuffPlugin.js +97 -97
  99. package/lib/NormalModuleReplacementPlugin.js +45 -45
  100. package/lib/NullFactory.js +12 -12
  101. package/lib/OptionsApply.js +10 -10
  102. package/lib/Parser.js +65 -34
  103. package/lib/ParserHelpers.js +85 -85
  104. package/lib/PrefetchPlugin.js +31 -31
  105. package/lib/ProgressPlugin.js +192 -192
  106. package/lib/ProvidePlugin.js +55 -55
  107. package/lib/RawModule.js +54 -54
  108. package/lib/RequestShortener.js +63 -63
  109. package/lib/RequireJsStuffPlugin.js +31 -31
  110. package/lib/RuleSet.js +444 -444
  111. package/lib/SetVarMainTemplatePlugin.js +41 -41
  112. package/lib/SingleEntryPlugin.js +35 -35
  113. package/lib/SizeFormatHelpers.js +18 -18
  114. package/lib/SourceMapDevToolModuleOptionsPlugin.js +37 -37
  115. package/lib/Stats.js +27 -8
  116. package/lib/UmdMainTemplatePlugin.js +1 -1
  117. package/lib/UnsupportedFeatureWarning.js +21 -21
  118. package/lib/UseStrictPlugin.js +34 -34
  119. package/lib/WarnCaseSensitiveModulesPlugin.js +31 -31
  120. package/lib/WatchIgnorePlugin.js +49 -49
  121. package/lib/WebpackError.js +11 -11
  122. package/lib/WebpackOptionsDefaulter.js +129 -129
  123. package/lib/WebpackOptionsValidationError.js +196 -196
  124. package/lib/compareLocations.js +36 -36
  125. package/lib/dependencies/AMDDefineDependency.js +142 -142
  126. package/lib/dependencies/AMDDefineDependencyParserPlugin.js +5 -1
  127. package/lib/dependencies/AMDPlugin.js +119 -119
  128. package/lib/dependencies/AMDRequireArrayDependency.js +2 -0
  129. package/lib/dependencies/AMDRequireContextDependency.js +0 -9
  130. package/lib/dependencies/AMDRequireDependenciesBlock.js +33 -33
  131. package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +177 -177
  132. package/lib/dependencies/AMDRequireDependency.js +67 -67
  133. package/lib/dependencies/AMDRequireItemDependency.js +22 -22
  134. package/lib/dependencies/CommonJsRequireContextDependency.js +0 -10
  135. package/lib/dependencies/CommonJsRequireDependency.js +22 -22
  136. package/lib/dependencies/CommonJsRequireDependencyParserPlugin.js +89 -89
  137. package/lib/dependencies/ConstDependency.js +32 -32
  138. package/lib/dependencies/ContextDependency.js +20 -0
  139. package/lib/dependencies/ContextDependencyHelpers.js +71 -71
  140. package/lib/dependencies/ContextElementDependency.js +21 -21
  141. package/lib/dependencies/CriticalDependencyWarning.js +20 -20
  142. package/lib/dependencies/DelegatedExportsDependency.js +33 -33
  143. package/lib/dependencies/DelegatedSourceDependency.js +18 -18
  144. package/lib/dependencies/DllEntryDependency.js +20 -20
  145. package/lib/dependencies/HarmonyCompatibilityDependency.js +30 -30
  146. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +14 -2
  147. package/lib/dependencies/HarmonyExportExpressionDependency.js +0 -7
  148. package/lib/dependencies/HarmonyExportHeaderDependency.js +28 -28
  149. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +45 -45
  150. package/lib/dependencies/HarmonyExportSpecifierDependency.js +0 -13
  151. package/lib/dependencies/HarmonyModulesHelpers.js +0 -53
  152. package/lib/dependencies/ImportContextDependency.js +0 -10
  153. package/lib/dependencies/ImportDependenciesBlock.js +17 -17
  154. package/lib/dependencies/ImportEagerContextDependency.js +22 -22
  155. package/lib/dependencies/ImportLazyContextDependency.js +22 -22
  156. package/lib/dependencies/ImportLazyOnceContextDependency.js +22 -22
  157. package/lib/dependencies/ImportParserPlugin.js +89 -89
  158. package/lib/dependencies/ImportPlugin.js +60 -60
  159. package/lib/dependencies/ImportWeakContextDependency.js +22 -22
  160. package/lib/dependencies/LoaderDependency.js +18 -18
  161. package/lib/dependencies/LoaderPlugin.js +60 -60
  162. package/lib/dependencies/LocalModule.js +23 -23
  163. package/lib/dependencies/LocalModuleDependency.js +24 -24
  164. package/lib/dependencies/LocalModulesHelpers.js +46 -46
  165. package/lib/dependencies/ModuleDependency.js +23 -23
  166. package/lib/dependencies/ModuleHotAcceptDependency.js +23 -23
  167. package/lib/dependencies/ModuleHotDeclineDependency.js +23 -23
  168. package/lib/dependencies/MultiEntryDependency.js +20 -20
  169. package/lib/dependencies/NullDependency.js +24 -24
  170. package/lib/dependencies/PrefetchDependency.js +18 -18
  171. package/lib/dependencies/RequireContextDependency.js +26 -26
  172. package/lib/dependencies/RequireContextDependencyParserPlugin.js +50 -50
  173. package/lib/dependencies/RequireContextPlugin.js +96 -96
  174. package/lib/dependencies/RequireEnsureDependenciesBlock.js +22 -22
  175. package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +102 -102
  176. package/lib/dependencies/RequireEnsureDependency.js +38 -38
  177. package/lib/dependencies/RequireEnsureItemDependency.js +21 -21
  178. package/lib/dependencies/RequireEnsurePlugin.js +40 -40
  179. package/lib/dependencies/RequireHeaderDependency.js +26 -26
  180. package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +21 -21
  181. package/lib/dependencies/RequireIncludePlugin.js +33 -33
  182. package/lib/dependencies/RequireResolveContextDependency.js +0 -10
  183. package/lib/dependencies/RequireResolveDependency.js +22 -22
  184. package/lib/dependencies/RequireResolveDependencyParserPlugin.js +71 -71
  185. package/lib/dependencies/RequireResolveHeaderDependency.js +26 -26
  186. package/lib/dependencies/SingleEntryDependency.js +18 -18
  187. package/lib/dependencies/SystemPlugin.js +44 -44
  188. package/lib/dependencies/UnsupportedDependency.js +23 -23
  189. package/lib/dependencies/WebpackMissingModule.js +18 -18
  190. package/lib/dependencies/getFunctionExpression.js +44 -44
  191. package/lib/formatLocation.js +54 -54
  192. package/lib/node/NodeChunkTemplatePlugin.js +27 -27
  193. package/lib/node/NodeEnvironmentPlugin.js +25 -25
  194. package/lib/node/NodeHotUpdateChunkTemplatePlugin.js +27 -27
  195. package/lib/node/NodeMainTemplate.runtime.js +24 -24
  196. package/lib/node/NodeMainTemplateAsync.runtime.js +40 -40
  197. package/lib/node/NodeOutputFileSystem.js +22 -22
  198. package/lib/node/NodeSourcePlugin.js +88 -88
  199. package/lib/node/NodeTargetPlugin.js +15 -15
  200. package/lib/node/NodeTemplatePlugin.js +27 -27
  201. package/lib/node/NodeWatchFileSystem.js +72 -72
  202. package/lib/optimize/ChunkModuleIdRangePlugin.js +53 -53
  203. package/lib/optimize/CommonsChunkPlugin.js +40 -19
  204. package/lib/optimize/ConcatenatedModule.js +27 -24
  205. package/lib/optimize/DedupePlugin.js +15 -15
  206. package/lib/optimize/FlagIncludedChunksPlugin.js +35 -35
  207. package/lib/optimize/LimitChunkCountPlugin.js +59 -59
  208. package/lib/optimize/MinChunkSizePlugin.js +65 -65
  209. package/lib/optimize/RemoveEmptyChunksPlugin.js +21 -21
  210. package/lib/optimize/UglifyJsPlugin.js +9 -9
  211. package/lib/performance/AssetsOverSizeLimitWarning.js +23 -23
  212. package/lib/performance/EntrypointsOverSizeLimitWarning.js +28 -28
  213. package/lib/performance/NoAsyncChunksWarning.js +20 -20
  214. package/lib/performance/SizeLimitsPlugin.js +102 -102
  215. package/lib/prepareOptions.js +29 -29
  216. package/lib/removeAndDo.js +15 -15
  217. package/lib/util/Queue.js +42 -0
  218. package/lib/util/Semaphore.js +32 -32
  219. package/lib/util/identifier.js +38 -38
  220. package/lib/validateSchema.js +66 -66
  221. package/lib/web/WebEnvironmentPlugin.js +18 -18
  222. package/lib/webpack.js +1 -0
  223. package/lib/webworker/WebWorkerChunkTemplatePlugin.js +29 -29
  224. package/lib/webworker/WebWorkerHotUpdateChunkTemplatePlugin.js +28 -28
  225. package/lib/webworker/WebWorkerMainTemplate.runtime.js +58 -58
  226. package/lib/webworker/WebWorkerTemplatePlugin.js +20 -20
  227. package/package.json +1 -1
  228. package/schemas/ajv.absolutePath.js +29 -29
  229. package/schemas/webpackOptionsSchema.json +69 -0
@@ -1,29 +1,29 @@
1
- /*
2
- MIT License http://www.opensource.org/licenses/mit-license.php
3
- Author Tobias Koppers @sokra
4
- */
5
- "use strict";
6
-
7
- const ConcatSource = require("webpack-sources").ConcatSource;
8
- const Template = require("../Template");
9
-
10
- class WebWorkerChunkTemplatePlugin {
11
-
12
- apply(chunkTemplate) {
13
- chunkTemplate.plugin("render", function(modules, chunk) {
14
- const chunkCallbackName = this.outputOptions.chunkCallbackName || Template.toIdentifier("webpackChunk" + (this.outputOptions.library || ""));
15
- const source = new ConcatSource();
16
- source.add(`${chunkCallbackName}(${JSON.stringify(chunk.ids)},`);
17
- source.add(modules);
18
- source.add(")");
19
- return source;
20
- });
21
- chunkTemplate.plugin("hash", function(hash) {
22
- hash.update("webworker");
23
- hash.update("3");
24
- hash.update(`${this.outputOptions.chunkCallbackName}`);
25
- hash.update(`${this.outputOptions.library}`);
26
- });
27
- }
28
- }
29
- module.exports = WebWorkerChunkTemplatePlugin;
1
+ /*
2
+ MIT License http://www.opensource.org/licenses/mit-license.php
3
+ Author Tobias Koppers @sokra
4
+ */
5
+ "use strict";
6
+
7
+ const ConcatSource = require("webpack-sources").ConcatSource;
8
+ const Template = require("../Template");
9
+
10
+ class WebWorkerChunkTemplatePlugin {
11
+
12
+ apply(chunkTemplate) {
13
+ chunkTemplate.plugin("render", function(modules, chunk) {
14
+ const chunkCallbackName = this.outputOptions.chunkCallbackName || Template.toIdentifier("webpackChunk" + (this.outputOptions.library || ""));
15
+ const source = new ConcatSource();
16
+ source.add(`${chunkCallbackName}(${JSON.stringify(chunk.ids)},`);
17
+ source.add(modules);
18
+ source.add(")");
19
+ return source;
20
+ });
21
+ chunkTemplate.plugin("hash", function(hash) {
22
+ hash.update("webworker");
23
+ hash.update("3");
24
+ hash.update(`${this.outputOptions.chunkCallbackName}`);
25
+ hash.update(`${this.outputOptions.library}`);
26
+ });
27
+ }
28
+ }
29
+ module.exports = WebWorkerChunkTemplatePlugin;
@@ -1,28 +1,28 @@
1
- /*
2
- MIT License http://www.opensource.org/licenses/mit-license.php
3
- Author Tobias Koppers @sokra
4
- */
5
- "use strict";
6
- const ConcatSource = require("webpack-sources").ConcatSource;
7
- const Template = require("../Template");
8
-
9
- class WebWorkerHotUpdateChunkTemplatePlugin {
10
-
11
- apply(hotUpdateChunkTemplate) {
12
- hotUpdateChunkTemplate.plugin("render", function(modulesSource, modules, removedModules, hash, id) {
13
- const chunkCallbackName = this.outputOptions.hotUpdateFunction || Template.toIdentifier("webpackHotUpdate" + (this.outputOptions.library || ""));
14
- const source = new ConcatSource();
15
- source.add(chunkCallbackName + "(" + JSON.stringify(id) + ",");
16
- source.add(modulesSource);
17
- source.add(")");
18
- return source;
19
- });
20
- hotUpdateChunkTemplate.plugin("hash", function(hash) {
21
- hash.update("WebWorkerHotUpdateChunkTemplatePlugin");
22
- hash.update("3");
23
- hash.update(this.outputOptions.hotUpdateFunction + "");
24
- hash.update(this.outputOptions.library + "");
25
- });
26
- }
27
- }
28
- module.exports = WebWorkerHotUpdateChunkTemplatePlugin;
1
+ /*
2
+ MIT License http://www.opensource.org/licenses/mit-license.php
3
+ Author Tobias Koppers @sokra
4
+ */
5
+ "use strict";
6
+ const ConcatSource = require("webpack-sources").ConcatSource;
7
+ const Template = require("../Template");
8
+
9
+ class WebWorkerHotUpdateChunkTemplatePlugin {
10
+
11
+ apply(hotUpdateChunkTemplate) {
12
+ hotUpdateChunkTemplate.plugin("render", function(modulesSource, modules, removedModules, hash, id) {
13
+ const chunkCallbackName = this.outputOptions.hotUpdateFunction || Template.toIdentifier("webpackHotUpdate" + (this.outputOptions.library || ""));
14
+ const source = new ConcatSource();
15
+ source.add(chunkCallbackName + "(" + JSON.stringify(id) + ",");
16
+ source.add(modulesSource);
17
+ source.add(")");
18
+ return source;
19
+ });
20
+ hotUpdateChunkTemplate.plugin("hash", function(hash) {
21
+ hash.update("WebWorkerHotUpdateChunkTemplatePlugin");
22
+ hash.update("3");
23
+ hash.update(this.outputOptions.hotUpdateFunction + "");
24
+ hash.update(this.outputOptions.library + "");
25
+ });
26
+ }
27
+ }
28
+ module.exports = WebWorkerHotUpdateChunkTemplatePlugin;
@@ -1,58 +1,58 @@
1
- /*
2
- MIT License http://www.opensource.org/licenses/mit-license.php
3
- Author Tobias Koppers @sokra
4
- */
5
- /*globals installedChunks hotAddUpdateChunk parentHotUpdateCallback importScripts XMLHttpRequest $require$ $hotChunkFilename$ $hotMainFilename$ */
6
- module.exports = function() {
7
- function webpackHotUpdateCallback(chunkId, moreModules) { // eslint-disable-line no-unused-vars
8
- hotAddUpdateChunk(chunkId, moreModules);
9
- if(parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules);
10
- } //$semicolon
11
-
12
- function hotDownloadUpdateChunk(chunkId) { // eslint-disable-line no-unused-vars
13
- importScripts($require$.p + $hotChunkFilename$);
14
- }
15
-
16
- function hotDownloadManifest(requestTimeout) { // eslint-disable-line no-unused-vars
17
- requestTimeout = requestTimeout || 10000;
18
- return new Promise(function(resolve, reject) {
19
- if(typeof XMLHttpRequest === "undefined")
20
- return reject(new Error("No browser support"));
21
- try {
22
- var request = new XMLHttpRequest();
23
- var requestPath = $require$.p + $hotMainFilename$;
24
- request.open("GET", requestPath, true);
25
- request.timeout = requestTimeout;
26
- request.send(null);
27
- } catch(err) {
28
- return reject(err);
29
- }
30
- request.onreadystatechange = function() {
31
- if(request.readyState !== 4) return;
32
- if(request.status === 0) {
33
- // timeout
34
- reject(new Error("Manifest request to " + requestPath + " timed out."));
35
- } else if(request.status === 404) {
36
- // no update available
37
- resolve();
38
- } else if(request.status !== 200 && request.status !== 304) {
39
- // other failure
40
- reject(new Error("Manifest request to " + requestPath + " failed."));
41
- } else {
42
- // success
43
- try {
44
- var update = JSON.parse(request.responseText);
45
- } catch(e) {
46
- reject(e);
47
- return;
48
- }
49
- resolve(update);
50
- }
51
- };
52
- });
53
- }
54
-
55
- function hotDisposeChunk(chunkId) { //eslint-disable-line no-unused-vars
56
- delete installedChunks[chunkId];
57
- }
58
- };
1
+ /*
2
+ MIT License http://www.opensource.org/licenses/mit-license.php
3
+ Author Tobias Koppers @sokra
4
+ */
5
+ /*globals installedChunks hotAddUpdateChunk parentHotUpdateCallback importScripts XMLHttpRequest $require$ $hotChunkFilename$ $hotMainFilename$ */
6
+ module.exports = function() {
7
+ function webpackHotUpdateCallback(chunkId, moreModules) { // eslint-disable-line no-unused-vars
8
+ hotAddUpdateChunk(chunkId, moreModules);
9
+ if(parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules);
10
+ } //$semicolon
11
+
12
+ function hotDownloadUpdateChunk(chunkId) { // eslint-disable-line no-unused-vars
13
+ importScripts($require$.p + $hotChunkFilename$);
14
+ }
15
+
16
+ function hotDownloadManifest(requestTimeout) { // eslint-disable-line no-unused-vars
17
+ requestTimeout = requestTimeout || 10000;
18
+ return new Promise(function(resolve, reject) {
19
+ if(typeof XMLHttpRequest === "undefined")
20
+ return reject(new Error("No browser support"));
21
+ try {
22
+ var request = new XMLHttpRequest();
23
+ var requestPath = $require$.p + $hotMainFilename$;
24
+ request.open("GET", requestPath, true);
25
+ request.timeout = requestTimeout;
26
+ request.send(null);
27
+ } catch(err) {
28
+ return reject(err);
29
+ }
30
+ request.onreadystatechange = function() {
31
+ if(request.readyState !== 4) return;
32
+ if(request.status === 0) {
33
+ // timeout
34
+ reject(new Error("Manifest request to " + requestPath + " timed out."));
35
+ } else if(request.status === 404) {
36
+ // no update available
37
+ resolve();
38
+ } else if(request.status !== 200 && request.status !== 304) {
39
+ // other failure
40
+ reject(new Error("Manifest request to " + requestPath + " failed."));
41
+ } else {
42
+ // success
43
+ try {
44
+ var update = JSON.parse(request.responseText);
45
+ } catch(e) {
46
+ reject(e);
47
+ return;
48
+ }
49
+ resolve(update);
50
+ }
51
+ };
52
+ });
53
+ }
54
+
55
+ function hotDisposeChunk(chunkId) { //eslint-disable-line no-unused-vars
56
+ delete installedChunks[chunkId];
57
+ }
58
+ };
@@ -1,20 +1,20 @@
1
- /*
2
- MIT License http://www.opensource.org/licenses/mit-license.php
3
- Author Tobias Koppers @sokra
4
- */
5
- "use strict";
6
-
7
- const WebWorkerMainTemplatePlugin = require("./WebWorkerMainTemplatePlugin");
8
- const WebWorkerChunkTemplatePlugin = require("./WebWorkerChunkTemplatePlugin");
9
- const WebWorkerHotUpdateChunkTemplatePlugin = require("./WebWorkerHotUpdateChunkTemplatePlugin");
10
-
11
- class WebWorkerTemplatePlugin {
12
- apply(compiler) {
13
- compiler.plugin("this-compilation", compilation => {
14
- compilation.mainTemplate.apply(new WebWorkerMainTemplatePlugin());
15
- compilation.chunkTemplate.apply(new WebWorkerChunkTemplatePlugin());
16
- compilation.hotUpdateChunkTemplate.apply(new WebWorkerHotUpdateChunkTemplatePlugin());
17
- });
18
- }
19
- }
20
- module.exports = WebWorkerTemplatePlugin;
1
+ /*
2
+ MIT License http://www.opensource.org/licenses/mit-license.php
3
+ Author Tobias Koppers @sokra
4
+ */
5
+ "use strict";
6
+
7
+ const WebWorkerMainTemplatePlugin = require("./WebWorkerMainTemplatePlugin");
8
+ const WebWorkerChunkTemplatePlugin = require("./WebWorkerChunkTemplatePlugin");
9
+ const WebWorkerHotUpdateChunkTemplatePlugin = require("./WebWorkerHotUpdateChunkTemplatePlugin");
10
+
11
+ class WebWorkerTemplatePlugin {
12
+ apply(compiler) {
13
+ compiler.plugin("this-compilation", compilation => {
14
+ compilation.mainTemplate.apply(new WebWorkerMainTemplatePlugin());
15
+ compilation.chunkTemplate.apply(new WebWorkerChunkTemplatePlugin());
16
+ compilation.hotUpdateChunkTemplate.apply(new WebWorkerHotUpdateChunkTemplatePlugin());
17
+ });
18
+ }
19
+ }
20
+ module.exports = WebWorkerTemplatePlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack",
3
- "version": "3.6.0",
3
+ "version": "3.8.1",
4
4
  "author": "Tobias Koppers @sokra",
5
5
  "description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",
6
6
  "dependencies": {
@@ -1,29 +1,29 @@
1
- "use strict";
2
-
3
- const getErrorFor = (shouldBeAbsolute, data, schema) => {
4
- const message = shouldBeAbsolute ?
5
- `The provided value ${JSON.stringify(data)} is not an absolute path!`
6
- : `A relative path is expected. However the provided value ${JSON.stringify(data)} is an absolute path!`;
7
-
8
- return {
9
- keyword: "absolutePath",
10
- params: { absolutePath: data },
11
- message: message,
12
- parentSchema: schema,
13
- };
14
- };
15
- module.exports = (ajv) => ajv.addKeyword("absolutePath", {
16
- errors: true,
17
- type: "string",
18
- compile(expected, schema) {
19
- function callback(data) {
20
- const passes = expected === /^(?:[A-Za-z]:\\|\/)/.test(data);
21
- if(!passes) {
22
- callback.errors = [getErrorFor(expected, data, schema)];
23
- }
24
- return passes;
25
- }
26
- callback.errors = [];
27
- return callback;
28
- }
29
- });
1
+ "use strict";
2
+
3
+ const getErrorFor = (shouldBeAbsolute, data, schema) => {
4
+ const message = shouldBeAbsolute ?
5
+ `The provided value ${JSON.stringify(data)} is not an absolute path!`
6
+ : `A relative path is expected. However the provided value ${JSON.stringify(data)} is an absolute path!`;
7
+
8
+ return {
9
+ keyword: "absolutePath",
10
+ params: { absolutePath: data },
11
+ message: message,
12
+ parentSchema: schema,
13
+ };
14
+ };
15
+ module.exports = (ajv) => ajv.addKeyword("absolutePath", {
16
+ errors: true,
17
+ type: "string",
18
+ compile(expected, schema) {
19
+ function callback(data) {
20
+ const passes = expected === /^(?:[A-Za-z]:\\|\/)/.test(data);
21
+ if(!passes) {
22
+ callback.errors = [getErrorFor(expected, data, schema)];
23
+ }
24
+ return passes;
25
+ }
26
+ callback.errors = [];
27
+ return callback;
28
+ }
29
+ });
@@ -975,6 +975,7 @@
975
975
  "anyOf": [
976
976
  {
977
977
  "type": "object",
978
+ "additionalProperties": false,
978
979
  "properties": {
979
980
  "context": {
980
981
  "type": "string",
@@ -993,10 +994,58 @@
993
994
  "type": "boolean",
994
995
  "description": "add timing information"
995
996
  },
997
+ "performance": {
998
+ "type": "boolean",
999
+ "description": "add performance hint flags"
1000
+ },
1001
+ "depth": {
1002
+ "type": "boolean",
1003
+ "description": "add module depth in module graph"
1004
+ },
996
1005
  "assets": {
997
1006
  "type": "boolean",
998
1007
  "description": "add assets information"
999
1008
  },
1009
+ "env": {
1010
+ "type": "boolean",
1011
+ "description": "add --env information"
1012
+ },
1013
+ "colors": {
1014
+ "oneOf": [
1015
+ {
1016
+ "type": "boolean",
1017
+ "description": "`webpack --colors` equivalent"
1018
+ },
1019
+ {
1020
+ "type": "object",
1021
+ "additionalProperties": false,
1022
+ "properties": {
1023
+ "bold": {
1024
+ "type": "string"
1025
+ },
1026
+ "red": {
1027
+ "type": "string"
1028
+ },
1029
+ "green": {
1030
+ "type": "string"
1031
+ },
1032
+ "cyan": {
1033
+ "type": "string"
1034
+ },
1035
+ "magenta": {
1036
+ "type": "string"
1037
+ },
1038
+ "yellow": {
1039
+ "type": "string"
1040
+ }
1041
+ }
1042
+ }
1043
+ ]
1044
+ },
1045
+ "maxModules": {
1046
+ "type": "number",
1047
+ "description": "Set the maximum number of modules to be shown"
1048
+ },
1000
1049
  "chunks": {
1001
1050
  "type": "boolean",
1002
1051
  "description": "add chunk information"
@@ -1017,6 +1066,10 @@
1017
1066
  "type": "boolean",
1018
1067
  "description": "add also information about cached (not built) modules"
1019
1068
  },
1069
+ "cachedAssets": {
1070
+ "type": "boolean",
1071
+ "description": "Show cached assets (setting this to `false` only shows emitted files)"
1072
+ },
1020
1073
  "reasons": {
1021
1074
  "type": "boolean",
1022
1075
  "description": "add information about the reasons why modules are included"
@@ -1025,6 +1078,14 @@
1025
1078
  "type": "boolean",
1026
1079
  "description": "add the source code of modules"
1027
1080
  },
1081
+ "warnings": {
1082
+ "type": "boolean",
1083
+ "description": "add warnings"
1084
+ },
1085
+ "errors": {
1086
+ "type": "boolean",
1087
+ "description": "add errors"
1088
+ },
1028
1089
  "warningsFilter": {
1029
1090
  "description": "Suppress warnings that match the specified filters. Filters can be Strings, RegExps or Functions",
1030
1091
  "$ref": "#/definitions/filter-types"
@@ -1041,6 +1102,10 @@
1041
1102
  "description": "Please use excludeModules instead.",
1042
1103
  "$ref": "#/definitions/filter-types"
1043
1104
  },
1105
+ "entrypoints": {
1106
+ "type": "boolean",
1107
+ "description": "Display the entry points with the corresponding bundles"
1108
+ },
1044
1109
  "errorDetails": {
1045
1110
  "type": "boolean",
1046
1111
  "description": "add details to errors (like resolving log)"
@@ -1065,6 +1130,10 @@
1065
1130
  "type": "string",
1066
1131
  "description": "sort the assets by that field"
1067
1132
  },
1133
+ "publicPath": {
1134
+ "type": "boolean",
1135
+ "description": "Add public path information"
1136
+ },
1068
1137
  "providedExports": {
1069
1138
  "type": "boolean",
1070
1139
  "description": "show exports provided by modules"