simple-squiggle

A restricted subset of Squiggle
Log | Files | Refs | README

AsyncDependencyToInitialChunkError.js (913B)


      1 /*
      2 	MIT License http://www.opensource.org/licenses/mit-license.php
      3 	Author Sean Larkin @thelarkinn
      4 */
      5 
      6 "use strict";
      7 
      8 const WebpackError = require("./WebpackError");
      9 
     10 /** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */
     11 /** @typedef {import("./Module")} Module */
     12 
     13 class 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 }
     30 
     31 module.exports = AsyncDependencyToInitialChunkError;