On this page

new CssModulesPlugin(): CssModulesPlugin
apply(compiler): void
Attributes
compiler:Compiler
the compiler instance
Returns:void

Applies the plugin by registering its hooks on the compiler.


getModulesInOrder(chunk, modules, compilation): Module[]
Attributes
chunk:Chunk
chunk
unordered modules
compilation:Compilation
compilation
Returns:Module[]
ordered modules

Gets modules in order.


getOrderedChunkCssModules(chunk, chunkGraph, compilation): CssModule[]
Attributes
chunk:Chunk
chunk
chunkGraph:ChunkGraph
chunk graph
compilation:Compilation
compilation
Returns:CssModule[]
ordered css modules

Gets ordered chunk css modules.


renderChunk(renderContextCssModulesPlugin, hooks): Source
Attributes
renderContextCssModulesPlugin:RenderContextCssModulesPlugin
Returns:Source
generated source

Renders generated source.


Attributes
chunk:Chunk
chunk
chunkGraph:ChunkGraph
chunk graph
Returns:boolean
true, when the chunk has css

Returns true, when the chunk has css.


Attributes
chunk:Chunk
chunk
output options
used filename template

Gets chunk filename template.


Attributes
compilation:Compilation
the compilation
the attached hooks

Returns the attached hooks.


Attributes
module:CssModule
css module
options object
Returns:Source | null
css module source

Renders css module source.

Attributes
chunk:Chunk
the chunk
chunkGraph:ChunkGraph
the chunk graph
codeGenerationResults:CodeGenerationResults
results of code generation
hash:string
compilation hash
moduleFactoryCache
moduleSourceContent:Source
content
runtimeTemplate:RuntimeTemplate
the runtime template
undoPath:string
undo path to css file

Attributes
chunkHash:SyncHook<[Chunk, Hash, ChunkHashContext]>
orderModules:SyncBailHook<[Chunk, Module[], Compilation], void | Module[] | undefined>
called for each CSS source type (CSS_IMPORT_TYPE, CSS_TYPE) with the chunk's modules pre-sorted by full module name; return an ordered Module[] to override the default import-order topological sort, or return undefined to keep the default
renderModulePackage:SyncWaterfallHook<[Source, Module, ChunkRenderContextCssModulesPlugin], Source>

Attributes
hash:string
The compilation hash
inheritance:[CssLayer, Supports, Media][]
The inheritance chain
The cached source
undoPath:string
The undo path to the CSS file

Attributes
chunk:Chunk
the chunk
chunkGraph:ChunkGraph
the chunk graph
codeGenerationResults:CodeGenerationResults
results of code generation
hash:string
compilation hash
modules:CssModule[]
modules
runtimeTemplate:RuntimeTemplate
the runtime template
undoPath:string
undo path to css file
uniqueName:string
the unique name