UNPKG

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