MCPcopy
hub / github.com/webpack/webpack / NormalModuleLoaderContext

Interface NormalModuleLoaderContext

types.d.ts:17389–17495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17387 * These properties are added by the NormalModule
17388 */
17389declare interface NormalModuleLoaderContext<OptionsType> {
17390 version: number;
17391
17392 /**
17393 * Extracts and parses the options of the current loader.
17394 * Parses string options as JSON or a query string.
17395 * Extracts and parses the options of the current loader.
17396 * Parses string options as JSON or a query string, and optionally validates them against a provided schema.
17397 */
17398
17399 /**
17400 * Extracts and parses the options of the current loader.
17401 * Parses string options as JSON or a query string.
17402 */
17403 getOptions(): OptionsType;
17404
17405 /**
17406 * Extracts and parses the options of the current loader.
17407 * Parses string options as JSON or a query string.
17408 * Extracts and parses the options of the current loader.
17409 * Parses string options as JSON or a query string, and optionally validates them against a provided schema.
17410 */
17411
17412 /**
17413 * Extracts and parses the options of the current loader.
17414 * Parses string options as JSON or a query string, and optionally validates them against a provided schema.
17415 */
17416 getOptions(schema: Parameters<typeof validateFunction>[0]): OptionsType;
17417
17418 /**
17419 * Emits a warning for this module.
17420 * The warning will be displayed to the user during compilation.
17421 */
17422 emitWarning(warning: string | Error): void;
17423
17424 /**
17425 * Emits an error for this module.
17426 * The error will be displayed to the user and typically causes the compilation to fail.
17427 */
17428 emitError(error: string | Error): void;
17429
17430 /**
17431 * Gets a logger instance scoped to this loader and module.
17432 * Useful for emitting debug or compilation information in a structured way.
17433 */
17434 getLogger(name?: string): WebpackLogger;
17435
17436 /**
17437 * Resolves a module request (e.g., a relative path or module name) to an absolute file path.
17438 * It uses Webpack's internal resolver, taking into account configured aliases and extensions.
17439 */
17440 resolve(
17441 context: string,
17442 request: string,
17443 callback: (
17444 err: null | ErrorWithDetail,
17445 res?: string | false,
17446 req?: ResolveRequest

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected