AsyncDependencyToInitialChunkError.js 871 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("./Module")} Module */
  8. class AsyncDependencyToInitialChunkError extends WebpackError {
  9. /**
  10. * Creates an instance of AsyncDependencyToInitialChunkError.
  11. * @param {string} chunkName Name of Chunk
  12. * @param {Module} module module tied to dependency
  13. * @param {TODO} loc location of dependency
  14. */
  15. constructor(chunkName, module, loc) {
  16. super(
  17. `It's not allowed to load an initial chunk on demand. The chunk name "${chunkName}" is already used by an entrypoint.`
  18. );
  19. this.name = "AsyncDependencyToInitialChunkError";
  20. this.module = module;
  21. this.loc = loc;
  22. Error.captureStackTrace(this, this.constructor);
  23. }
  24. }
  25. module.exports = AsyncDependencyToInitialChunkError;