AsyncDependencyToInitialChunkError.js 913 B

12345678910111213141516171819202122232425262728293031
  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. this.name = "AsyncDependencyToInitialChunkError";
  21. this.module = module;
  22. this.loc = loc;
  23. }
  24. }
  25. module.exports = AsyncDependencyToInitialChunkError;