webpack 4.27.0 → 4.27.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/LICENSE CHANGED
@@ -1,20 +1,20 @@
1
- Copyright JS Foundation and other contributors
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- 'Software'), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright JS Foundation and other contributors
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ 'Software'), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/SECURITY.md CHANGED
@@ -1,9 +1,9 @@
1
- # Reporting Security Issues
2
-
3
- If you discover a security issue in webpack, please report it by sending an
4
- email to [webpack@opencollective.com](mailto:webpack@opencollective.com).
5
-
6
- This will allow us to assess the risk, and make a fix available before we add a
7
- bug report to the GitHub repository.
8
-
9
- Thanks for helping make webpack safe for everyone.
1
+ # Reporting Security Issues
2
+
3
+ If you discover a security issue in webpack, please report it by sending an
4
+ email to [webpack@opencollective.com](mailto:webpack@opencollective.com).
5
+
6
+ This will allow us to assess the risk, and make a fix available before we add a
7
+ bug report to the GitHub repository.
8
+
9
+ Thanks for helping make webpack safe for everyone.
@@ -1,3 +1,3 @@
1
- module.exports = function() {
2
- throw new Error("define cannot be used indirect");
3
- };
1
+ module.exports = function() {
2
+ throw new Error("define cannot be used indirect");
3
+ };
@@ -1,2 +1,2 @@
1
- /* globals __webpack_amd_options__ */
2
- module.exports = __webpack_amd_options__;
1
+ /* globals __webpack_amd_options__ */
2
+ module.exports = __webpack_amd_options__;
package/buildin/module.js CHANGED
@@ -1,22 +1,22 @@
1
- module.exports = function(module) {
2
- if (!module.webpackPolyfill) {
3
- module.deprecate = function() {};
4
- module.paths = [];
5
- // module.parent = undefined by default
6
- if (!module.children) module.children = [];
7
- Object.defineProperty(module, "loaded", {
8
- enumerable: true,
9
- get: function() {
10
- return module.l;
11
- }
12
- });
13
- Object.defineProperty(module, "id", {
14
- enumerable: true,
15
- get: function() {
16
- return module.i;
17
- }
18
- });
19
- module.webpackPolyfill = 1;
20
- }
21
- return module;
22
- };
1
+ module.exports = function(module) {
2
+ if (!module.webpackPolyfill) {
3
+ module.deprecate = function() {};
4
+ module.paths = [];
5
+ // module.parent = undefined by default
6
+ if (!module.children) module.children = [];
7
+ Object.defineProperty(module, "loaded", {
8
+ enumerable: true,
9
+ get: function() {
10
+ return module.l;
11
+ }
12
+ });
13
+ Object.defineProperty(module, "id", {
14
+ enumerable: true,
15
+ get: function() {
16
+ return module.i;
17
+ }
18
+ });
19
+ module.webpackPolyfill = 1;
20
+ }
21
+ return module;
22
+ };
package/buildin/system.js CHANGED
@@ -1,7 +1,7 @@
1
- // Provide a "System" global.
2
- module.exports = {
3
- // Make sure import is only used as "System.import"
4
- import: function() {
5
- throw new Error("System.import cannot be used indirectly");
6
- }
7
- };
1
+ // Provide a "System" global.
2
+ module.exports = {
3
+ // Make sure import is only used as "System.import"
4
+ import: function() {
5
+ throw new Error("System.import cannot be used indirectly");
6
+ }
7
+ };
package/hot/emitter.js CHANGED
@@ -1,2 +1,2 @@
1
- var EventEmitter = require("events");
2
- module.exports = new EventEmitter();
1
+ var EventEmitter = require("events");
2
+ module.exports = new EventEmitter();
@@ -465,11 +465,7 @@ module.exports = class SplitChunksPlugin {
465
465
  module
466
466
  ) => {
467
467
  // Break if minimum number of chunks is not reached
468
- if (
469
- !cacheGroup.enforce &&
470
- selectedChunks.length < cacheGroup.minChunks
471
- )
472
- return;
468
+ if (selectedChunks.length < cacheGroup.minChunks) return;
473
469
  // Determine name for split chunk
474
470
  const name = cacheGroup.getName(
475
471
  module,
@@ -492,7 +488,7 @@ module.exports = class SplitChunksPlugin {
492
488
  modules: new SortableSet(undefined, sortByIdentifier),
493
489
  cacheGroup,
494
490
  name,
495
- validateSize: !cacheGroup.enforce && cacheGroup.minSize > 0,
491
+ validateSize: cacheGroup.minSize > 0,
496
492
  size: 0,
497
493
  chunks: new Set(),
498
494
  reuseableChunks: new Set(),
@@ -534,27 +530,40 @@ module.exports = class SplitChunksPlugin {
534
530
  priority: cacheGroupSource.priority || 0,
535
531
  chunksFilter:
536
532
  cacheGroupSource.chunksFilter || this.options.chunksFilter,
537
- enforce: cacheGroupSource.enforce,
538
533
  minSize:
534
+ cacheGroupSource.minSize !== undefined
535
+ ? cacheGroupSource.minSize
536
+ : cacheGroupSource.enforce
537
+ ? 0
538
+ : this.options.minSize,
539
+ minSizeForMaxSize:
539
540
  cacheGroupSource.minSize !== undefined
540
541
  ? cacheGroupSource.minSize
541
542
  : this.options.minSize,
542
543
  maxSize:
543
544
  cacheGroupSource.maxSize !== undefined
544
545
  ? cacheGroupSource.maxSize
545
- : this.options.maxSize,
546
+ : cacheGroupSource.enforce
547
+ ? 0
548
+ : this.options.maxSize,
546
549
  minChunks:
547
550
  cacheGroupSource.minChunks !== undefined
548
551
  ? cacheGroupSource.minChunks
549
- : this.options.minChunks,
552
+ : cacheGroupSource.enforce
553
+ ? 1
554
+ : this.options.minChunks,
550
555
  maxAsyncRequests:
551
556
  cacheGroupSource.maxAsyncRequests !== undefined
552
557
  ? cacheGroupSource.maxAsyncRequests
553
- : this.options.maxAsyncRequests,
558
+ : cacheGroupSource.enforce
559
+ ? Infinity
560
+ : this.options.maxAsyncRequests,
554
561
  maxInitialRequests:
555
562
  cacheGroupSource.maxInitialRequests !== undefined
556
563
  ? cacheGroupSource.maxInitialRequests
557
- : this.options.maxInitialRequests,
564
+ : cacheGroupSource.enforce
565
+ ? Infinity
566
+ : this.options.maxInitialRequests,
558
567
  getName:
559
568
  cacheGroupSource.getName !== undefined
560
569
  ? cacheGroupSource.getName
@@ -572,11 +581,7 @@ module.exports = class SplitChunksPlugin {
572
581
  // For all combination of chunk selection
573
582
  for (const chunkCombination of combs) {
574
583
  // Break if minimum number of chunks is not reached
575
- if (
576
- !cacheGroup.enforce &&
577
- chunkCombination.size < cacheGroup.minChunks
578
- )
579
- continue;
584
+ if (chunkCombination.size < cacheGroup.minChunks) continue;
580
585
  // Select chunks by configuration
581
586
  const {
582
587
  chunks: selectedChunks,
@@ -586,14 +591,12 @@ module.exports = class SplitChunksPlugin {
586
591
  cacheGroup.chunksFilter
587
592
  );
588
593
 
589
- if (selectedChunks.length > 0) {
590
- addModuleToChunksInfoMap(
591
- cacheGroup,
592
- selectedChunks,
593
- selectedChunksKey,
594
- module
595
- );
596
- }
594
+ addModuleToChunksInfoMap(
595
+ cacheGroup,
596
+ selectedChunks,
597
+ selectedChunksKey,
598
+ module
599
+ );
597
600
  }
598
601
  }
599
602
  }
@@ -672,9 +675,8 @@ module.exports = class SplitChunksPlugin {
672
675
  if (usedChunks.length === 0) continue;
673
676
 
674
677
  if (
675
- !item.cacheGroup.enforce &&
676
- (Number.isFinite(item.cacheGroup.maxInitialRequests) ||
677
- Number.isFinite(item.cacheGroup.maxAsyncRequests))
678
+ Number.isFinite(item.cacheGroup.maxInitialRequests) ||
679
+ Number.isFinite(item.cacheGroup.maxAsyncRequests)
678
680
  ) {
679
681
  const chunkInLimit = usedChunks.filter(chunk => {
680
682
  // respect max requests when not enforced
@@ -692,8 +694,6 @@ module.exports = class SplitChunksPlugin {
692
694
  });
693
695
 
694
696
  if (chunkInLimit.length < usedChunks.length) {
695
- // We do not need to check enforce here as it was
696
- // already checked above.
697
697
  if (chunkInLimit.length >= item.cacheGroup.minChunks) {
698
698
  for (const module of item.modules) {
699
699
  addModuleToChunksInfoMap(
@@ -775,7 +775,7 @@ module.exports = class SplitChunksPlugin {
775
775
  maxSizeQueueMap.set(newChunk, {
776
776
  minSize: Math.max(
777
777
  oldMaxSizeSettings ? oldMaxSizeSettings.minSize : 0,
778
- item.cacheGroup.minSize
778
+ item.cacheGroup.minSizeForMaxSize
779
779
  ),
780
780
  maxSize: Math.min(
781
781
  oldMaxSizeSettings ? oldMaxSizeSettings.maxSize : Infinity,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack",
3
- "version": "4.27.0",
3
+ "version": "4.27.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
  "license": "MIT",