On this page

These types are not exported by webpack, but they are available to TypeScript consumers.

Attributes
context:string
the directory in which the request is placed
contextual information
dependencyType:string
the category of the referencing dependency
getResolve:(options?: ResolveOptions) => ((context: string, request: string, callback: (err?: Error | null, result?: string | false, resolveRequest?: ResolveRequest) => void) => void) | ((context: string, request: string) => Promise<string>)
get a resolve function with the current resolver options
request:string
the request as written by the user in the require/import expression/statement

If an dependency matches exactly a property of the object, the property value is used as dependency.

Attributes
byLayer:{ [index: string]: ExternalItem } | ((layer: string | null) => ExternalItem)
Specify externals depending on the layer.

If an dependency matches exactly a property of the object, the property value is used as dependency.


The target of the external with a type, optionally with an 'interop' hint describing how its exports interoperate with ES module imports.

Attributes
interop:"default" | "esModule"
How an external's exports interoperate with ES module imports, independent of the importing module's strictness (similar to Rollup's output.interop ). 'default': treat as CommonJS, the default import is the whole exports (Node.js semantics). 'esModule': treat as an ES module namespace, the default import is unboxed to .default .

The target of the external with a type, optionally with an 'interop' hint describing how its exports interoperate with ES module imports.


Enable presets of externals for specific targets.

Attributes
Treat bun built-in modules like 'bun', 'bun:sqlite' or 'bun:ffi' and node.js built-in modules as external and load them via import when used (for the Bun runtime).
deno:boolean
Treat node.js built-in modules like fs, path or vm as external and load them via the required 'node:' specifier when used (for the Deno runtime).
electron:boolean
Treat common electron built-in modules in main and preload context like 'electron', 'ipc' or 'shell' as external and load them via require() when used.
electronMain:boolean
Treat electron built-in modules in the main context like 'app', 'ipc-main' or 'shell' as external and load them via require() when used.
electronPreload:boolean
Treat electron built-in modules in the preload context like 'web-frame', 'ipc-renderer' or 'shell' as external and load them via require() when used.
electronRenderer:boolean
Treat electron built-in modules in the renderer context like 'web-frame', 'ipc-renderer' or 'shell' as external and load them via require() when used.
node:boolean
Treat node.js built-in modules like fs, path or vm as external and load them via require() when used.
nwjs:boolean
Treat NW.js legacy nw.gui module as external and load it via require() when used.
Treat references to 'http(s)://...' and 'std:...' as external and load them via import when used (Note that this changes execution order as externals are executed before any other code in the chunk).
webAsync:boolean
Treat references to 'http(s)://...' and 'std:...' as external and load them via async import() when used (Note that this external type is an async module, which has various effects on the execution).



Attributes

Attributes
Returns:((context: string, request: string, callback: (err?: null | Error, result?: string | false, resolveRequest?: ResolveRequest) => void) => void) | ((context: string, request: string) => Promise<string>)

Attributes
context:string
request:string
callback:(err?: null | Error, result?: string | false, resolveRequest?: ResolveRequest) => void
Returns:void

Attributes
context:string
request:string
Returns:Promise<string>

Attributes




Attributes

Type:"import" | "var" | "module" | "assign" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "jsonp" | "system" | "amd-async" | "promise" | "module-import" | "script" | "node-commonjs" | "asset" | "asset-url" | "css-import" | "css-url"