RuntimeInLargeChunkWarning.js 960 B

123456789101112131415161718192021222324252627
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Alexander Akait @alexander-akait
  4. */
  5. "use strict";
  6. const WebpackError = require("../errors/WebpackError");
  7. class RuntimeInLargeChunkWarning extends WebpackError {
  8. /**
  9. * Creates an instance of RuntimeInLargeChunkWarning.
  10. * @param {string[]} entrypoints names of the entrypoints carrying the runtime
  11. */
  12. constructor(entrypoints) {
  13. super(
  14. `webpack performance recommendations: \nThe runtime is part of the initial chunk of ${entrypoints.join(
  15. ", "
  16. )}. It describes every other chunk, so a change anywhere in the build rewrites these assets and clients download them again.\nSet 'optimization.runtimeChunk' to emit the runtime as its own chunk.\nFor more info visit https://webpack.js.org/configuration/optimization/#optimizationruntimechunk`
  17. );
  18. /** @type {string} */
  19. this.name = "RuntimeInLargeChunkWarning";
  20. }
  21. }
  22. module.exports = RuntimeInLargeChunkWarning;