new JavascriptModulesPlugin(options?): JavascriptModulesPlugin
Attributes
options:
objectReturns:
JavascriptModulesPluginAttributes
options:
objectchunkHasJs:
(chunk: Chunk, chunkGraph: ChunkGraph) => booleanReturns true, when a JS file is needed for this chunk.
getCompilationHooks:
(compilation: Compilation) => { chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>; embedInRuntimeBailout: SyncBailHook<[Module, RenderContextJavascriptModulesPlugin], string | void>; inlineInRuntimeBailout: SyncBailHook<[Module, Partial<RenderBootstrapContext>], string | void>; render: SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>; renderChunk: SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>; renderContent: SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>; renderMain: SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>; renderModuleContainer: SyncWaterfallHook<[Source, Module, ModuleRenderContext], Source>; renderModuleContent: SyncWaterfallHook<[Source, Module, ModuleRenderContext], Source>; renderModulePackage: SyncWaterfallHook<[Source, Module, ModuleRenderContext], Source>; renderRequire: SyncWaterfallHook<[string, RenderBootstrapContext], string>; renderStartup: SyncWaterfallHook<[Source, Module, StartupRenderContext], Source>; strictRuntimeBailout: SyncBailHook<[RenderContextJavascriptModulesPlugin], string | void>; useSourceMap: SyncBailHook<[Chunk, RenderContextJavascriptModulesPlugin], boolean | void> }apply(compiler): void
Attributes
Applies the plugin by registering its hooks on the compiler.
renderBootstrap(renderContext, hooks): Bootstrap
Attributes
renderContext:
RenderBootstrapContextoptions object
chunkHash:
SyncHook<[Chunk, Hash, ChunkHashContext]>embedInRuntimeBailout:
SyncBailHook<[Module, RenderContextJavascriptModulesPlugin], string | void>inlineInRuntimeBailout:
SyncBailHook<[Module, Partial<RenderBootstrapContext>], string | void>render:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderChunk:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderContent:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderMain:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderModuleContainer:
SyncWaterfallHook<[Source, Module, ModuleRenderContext], Source>renderModuleContent:
SyncWaterfallHook<[Source, Module, ModuleRenderContext], Source>renderModulePackage:
SyncWaterfallHook<[Source, Module, ModuleRenderContext], Source>renderRequire:
SyncWaterfallHook<[string, RenderBootstrapContext], string>renderStartup:
SyncWaterfallHook<[Source, Module, StartupRenderContext], Source>strictRuntimeBailout:
SyncBailHook<[RenderContextJavascriptModulesPlugin], string | void>useSourceMap:
SyncBailHook<[Chunk, RenderContextJavascriptModulesPlugin], boolean | void>Returns:
Bootstrapthe generated source of the bootstrap code
Renders the generated source of the bootstrap code.
renderChunk(renderContext, hooks): Source
Attributes
renderContext:
RenderContextJavascriptModulesPluginthe render context
chunkHash:
SyncHook<[Chunk, Hash, ChunkHashContext]>embedInRuntimeBailout:
SyncBailHook<[Module, RenderContextJavascriptModulesPlugin], string | void>inlineInRuntimeBailout:
SyncBailHook<[Module, Partial<RenderBootstrapContext>], string | void>render:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderChunk:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderContent:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderMain:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderModuleContainer:
SyncWaterfallHook<[Source, Module, ModuleRenderContext], Source>renderModuleContent:
SyncWaterfallHook<[Source, Module, ModuleRenderContext], Source>renderModulePackage:
SyncWaterfallHook<[Source, Module, ModuleRenderContext], Source>renderRequire:
SyncWaterfallHook<[string, RenderBootstrapContext], string>renderStartup:
SyncWaterfallHook<[Source, Module, StartupRenderContext], Source>strictRuntimeBailout:
SyncBailHook<[RenderContextJavascriptModulesPlugin], string | void>useSourceMap:
SyncBailHook<[Chunk, RenderContextJavascriptModulesPlugin], boolean | void>Returns:
Sourcethe rendered source
Renders the rendered source.
renderMain(renderContext, hooks, compilation): Source
Attributes
renderContext:
MainRenderContextoptions object
chunkHash:
SyncHook<[Chunk, Hash, ChunkHashContext]>embedInRuntimeBailout:
SyncBailHook<[Module, RenderContextJavascriptModulesPlugin], string | void>inlineInRuntimeBailout:
SyncBailHook<[Module, Partial<RenderBootstrapContext>], string | void>render:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderChunk:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderContent:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderMain:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderModuleContainer:
SyncWaterfallHook<[Source, Module, ModuleRenderContext], Source>renderModuleContent:
SyncWaterfallHook<[Source, Module, ModuleRenderContext], Source>renderModulePackage:
SyncWaterfallHook<[Source, Module, ModuleRenderContext], Source>renderRequire:
SyncWaterfallHook<[string, RenderBootstrapContext], string>renderStartup:
SyncWaterfallHook<[Source, Module, StartupRenderContext], Source>strictRuntimeBailout:
SyncBailHook<[RenderContextJavascriptModulesPlugin], string | void>useSourceMap:
SyncBailHook<[Chunk, RenderContextJavascriptModulesPlugin], boolean | void>compilation:
Compilationthe compilation
Returns:
Sourcethe newly generated source from rendering
Renders the newly generated source from rendering.
renderModule(module, renderContext, hooks): Source | null
Attributes
module:
Modulethe rendered module
renderContext:
ModuleRenderContextoptions object
chunkHash:
SyncHook<[Chunk, Hash, ChunkHashContext]>embedInRuntimeBailout:
SyncBailHook<[Module, RenderContextJavascriptModulesPlugin], string | void>inlineInRuntimeBailout:
SyncBailHook<[Module, Partial<RenderBootstrapContext>], string | void>render:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderChunk:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderContent:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderMain:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderModuleContainer:
SyncWaterfallHook<[Source, Module, ModuleRenderContext], Source>renderModuleContent:
SyncWaterfallHook<[Source, Module, ModuleRenderContext], Source>renderModulePackage:
SyncWaterfallHook<[Source, Module, ModuleRenderContext], Source>renderRequire:
SyncWaterfallHook<[string, RenderBootstrapContext], string>renderStartup:
SyncWaterfallHook<[Source, Module, StartupRenderContext], Source>strictRuntimeBailout:
SyncBailHook<[RenderContextJavascriptModulesPlugin], string | void>useSourceMap:
SyncBailHook<[Chunk, RenderContextJavascriptModulesPlugin], boolean | void>Renders the newly generated source from rendering.
renderRequire(renderContext, hooks): string
Attributes
renderContext:
RenderBootstrapContextoptions object
chunkHash:
SyncHook<[Chunk, Hash, ChunkHashContext]>embedInRuntimeBailout:
SyncBailHook<[Module, RenderContextJavascriptModulesPlugin], string | void>inlineInRuntimeBailout:
SyncBailHook<[Module, Partial<RenderBootstrapContext>], string | void>render:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderChunk:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderContent:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderMain:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderModuleContainer:
SyncWaterfallHook<[Source, Module, ModuleRenderContext], Source>renderModuleContent:
SyncWaterfallHook<[Source, Module, ModuleRenderContext], Source>renderModulePackage:
SyncWaterfallHook<[Source, Module, ModuleRenderContext], Source>renderRequire:
SyncWaterfallHook<[string, RenderBootstrapContext], string>renderStartup:
SyncWaterfallHook<[Source, Module, StartupRenderContext], Source>strictRuntimeBailout:
SyncBailHook<[RenderContextJavascriptModulesPlugin], string | void>useSourceMap:
SyncBailHook<[Chunk, RenderContextJavascriptModulesPlugin], boolean | void>Returns:
stringthe generated source of the require function
Renders the generated source of the require function.
updateHashWithBootstrap(hash, renderContext, hooks): void
Attributes
hash:
Hashthe hash to be updated
renderContext:
RenderBootstrapContextoptions object
chunkHash:
SyncHook<[Chunk, Hash, ChunkHashContext]>embedInRuntimeBailout:
SyncBailHook<[Module, RenderContextJavascriptModulesPlugin], string | void>inlineInRuntimeBailout:
SyncBailHook<[Module, Partial<RenderBootstrapContext>], string | void>render:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderChunk:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderContent:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderMain:
SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin], Source>renderModuleContainer:
SyncWaterfallHook<[Source, Module, ModuleRenderContext], Source>renderModuleContent:
SyncWaterfallHook<[Source, Module, ModuleRenderContext], Source>renderModulePackage:
SyncWaterfallHook<[Source, Module, ModuleRenderContext], Source>renderRequire:
SyncWaterfallHook<[string, RenderBootstrapContext], string>renderStartup:
SyncWaterfallHook<[Source, Module, StartupRenderContext], Source>strictRuntimeBailout:
SyncBailHook<[RenderContextJavascriptModulesPlugin], string | void>useSourceMap:
SyncBailHook<[Chunk, RenderContextJavascriptModulesPlugin], boolean | void>Returns:
voidUpdates hash with bootstrap.
Attributes
chunk:
Chunkchunk
outputOptions:
OutputNormalizedWithDefaultsoutput options
Returns:
ChunkFilenameTemplateused filename template
Gets chunk filename template.
Attributes
Attributes
chunk:
Chunkthe chunk
chunkGraph:
ChunkGraphthe chunk graph
codeGenerationResults:
CodeGenerationResultsresults of code generation
dependencyTemplates:
DependencyTemplatesthe dependency templates
hash:
stringhash to be used for render call
moduleGraph:
ModuleGraphthe module graph
runtimeTemplate:
RuntimeTemplatethe runtime template
strictMode:
booleanrendering in strict context