You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
819 B

4 years ago
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const WebpackError = require("../WebpackError");
  7. const SizeFormatHelpers = require("../SizeFormatHelpers");
  8. class MinMaxSizeWarning extends WebpackError {
  9. constructor(keys, minSize, maxSize) {
  10. let keysMessage = "Fallback cache group";
  11. if (keys) {
  12. keysMessage =
  13. keys.length > 1
  14. ? `Cache groups ${keys.sort().join(", ")}`
  15. : `Cache group ${keys[0]}`;
  16. }
  17. super(
  18. `SplitChunksPlugin\n` +
  19. `${keysMessage}\n` +
  20. `Configured minSize (${SizeFormatHelpers.formatSize(minSize)}) is ` +
  21. `bigger than maxSize (${SizeFormatHelpers.formatSize(maxSize)}).\n` +
  22. "This seem to be a invalid optimiziation.splitChunks configuration."
  23. );
  24. }
  25. }
  26. module.exports = MinMaxSizeWarning;