UNPKG

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