On this page

new VirtualUrlPlugin(modules, schemeOrOptions?): VirtualUrlPlugin
Attributes
The virtual modules
schemeOrOptions:string | Omit<VirtualUrlOptions, "modules">
The URL scheme to use

Creates an instance of VirtualUrlPlugin.

Attributes
context:string
scheme:string
DEFAULT_SCHEME:string
apply(compiler): void
Attributes
compiler:Compiler
the compiler instance
Returns:void

Applies the plugin by registering its hooks on the compiler.


findVirtualModuleConfigById(id): VirtualModule
Attributes
The module id
The virtual module config

Finds virtual module config by id.


getCacheVersion(version): string | undefined
Attributes
version:string | true | (() => string)
The version value or function
Returns:string | undefined
The cache version

Get the cache version for a given version value



A virtual module definition.

Attributes
context:string
The context for the virtual module. A string path. Defaults to 'auto', which will try to resolve the context from the module id.
source:(loaderContext: LoaderContext<any>) => string | Buffer<ArrayBufferLike> | Promise<string | Buffer<ArrayBufferLike>>
The source function that provides the virtual content.
type:string
The module type.
version:string | true | (() => string)
Optional version function or value for cache invalidation.

Type:string | ((loaderContext: LoaderContext<any>) => string | Buffer | Promise<string | Buffer>) | VirtualModule


Options for building virtual resources.

Attributes
context:string
The default context for virtual modules. A string path. Defaults to 'auto', which will try to resolve the context from the module id.
modules:{ [index: string]: VirtualModuleContent }
The virtual modules configuration.
scheme:string
The URL scheme to use for virtual resources.