new JavascriptModulesPlugin(options?): JavascriptModulesPluginAttributes
options:
objectReturns:
JavascriptModulesPluginAttributes
options:
objectchunkHasJs:
(chunk: Chunk, chunkGraph: ChunkGraph) => booleanReturns true, when a JS file is needed for this chunk.
apply(compiler): voidAttributes
Applies the plugin by registering its hooks on the compiler.
renderBootstrap(renderContext, hooks): BootstrapAttributes
renderContext:
RenderBootstrapContextoptions object
hooks
Returns:
Bootstrapthe generated source of the bootstrap code
Renders the generated source of the bootstrap code.
renderChunk(renderContext, hooks): SourceAttributes
renderContext:
RenderContextJavascriptModulesPluginthe render context
hooks
Returns:
Sourcethe rendered source
Renders the rendered source.
renderMain(renderContext, hooks, compilation): SourceAttributes
renderContext:
MainRenderContextoptions object
hooks
compilation:
Compilationthe compilation
Returns:
Sourcethe newly generated source from rendering
Renders the newly generated source from rendering.
renderModule(module, renderContext, hooks): Source | nullAttributes
module:
Modulethe rendered module
renderContext:
ModuleRenderContextoptions object
hooks
Returns:
Source | nullthe newly generated source from rendering
Renders the newly generated source from rendering.
renderRequire(renderContext, hooks): stringAttributes
renderContext:
RenderBootstrapContextoptions object
hooks
Returns:
stringthe generated source of the require function
Renders the generated source of the require function.
updateHashWithBootstrap(hash, renderContext, hooks): voidAttributes
Updates hash with bootstrap.
Attributes
chunk:
Chunkchunk
outputOptions:
OutputNormalizedWithDefaultsoutput options
Returns:
ChunkFilenameTemplateused filename template
Gets chunk filename template.
Attributes
compilation:
Compilationthe compilation
the attached hooks
Returns the attached hooks.
Attributes
Attributes
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>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