AsyncDependencyToInitialChunkError.js 997 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Sean Larkin @thelarkinn
  4. */
  5. "use strict";
  6. const WebpackError = require("./WebpackError");
  7. /** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */
  8. /** @typedef {import("./Module")} Module */
  9. class AsyncDependencyToInitialChunkError extends WebpackError {
  10. /**
  11. * Creates an instance of AsyncDependencyToInitialChunkError.
  12. * @param {string} chunkName Name of Chunk
  13. * @param {Module} module module tied to dependency
  14. * @param {DependencyLocation} loc location of dependency
  15. */
  16. constructor(chunkName, module, loc) {
  17. super(
  18. `It's not allowed to load an initial chunk on demand. The chunk name "${chunkName}" is already used by an entrypoint.`
  19. );
  20. /** @type {string} */
  21. this.name = "AsyncDependencyToInitialChunkError";
  22. /** @type {Module} */
  23. this.module = module;
  24. /** @type {DependencyLocation} */
  25. this.loc = loc;
  26. }
  27. }
  28. module.exports = AsyncDependencyToInitialChunkError;