new VirtualUrlPlugin(modules, schemeOrOptions?): VirtualUrlPluginAttributes
modules:
VirtualModulesThe virtual modules
schemeOrOptions:
string | Omit<VirtualUrlOptions, "modules">The URL scheme to use
Returns:
VirtualUrlPluginCreates an instance of VirtualUrlPlugin.
Attributes
apply(compiler): voidAttributes
Applies the plugin by registering its hooks on the compiler.
findVirtualModuleConfigById(id): VirtualModuleAttributes
id:
stringThe module id
Returns:
VirtualModuleThe virtual module config
Finds virtual module config by id.
getCacheVersion(version): string | undefinedAttributes
Get the cache version for a given version value
Type:
NormalModuleLoaderContext<OptionsType> & LoaderRunnerLoaderContext<OptionsType> & LoaderPluginLoaderContext & HotModuleReplacementPluginLoaderContext[index: {string}]VirtualModule
A virtual module definition.
Attributes
context:
stringThe 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:
stringThe module type.
Type:
string | ((loaderContext: LoaderContext<any>) => string | Buffer | Promise<string | Buffer>) | VirtualModule[index: {string}]VirtualModuleContent
Options for building virtual resources.
Attributes
context:
stringThe 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:
stringThe URL scheme to use for virtual resources.