On this page

Source Code: lib/css/CssModulesPlugin.js#L243
new CssModulesPlugin(): CssModulesPlugin
Source Code: lib/css/CssModulesPlugin.js#L244
CssModulesPlugin.getCompilationHooks(compilation): { chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>; orderModules: SyncBailHook<[Chunk, Module[], Compilation], void | Module[] | undefined>; renderModulePackage: SyncWaterfallHook<[Source, Module, ChunkRenderContextCssModulesPlugin], Source> }
Attributes
compilation:Compilation
Returns:{ chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>; orderModules: SyncBailHook<[Chunk, Module[], Compilation], void | Module[] | undefined>; renderModulePackage: SyncWaterfallHook<[Source, Module, ChunkRenderContextCssModulesPlugin], Source> }
cssModulesPlugin.apply(compiler): void
Source Code: lib/css/CssModulesPlugin.js#L254
Attributes
compiler:Compiler

Applies the plugin by registering its hooks on the compiler.

cssModulesPlugin.getModulesInOrder(chunk, modules, compilation): Module[]
Source Code: lib/css/CssModulesPlugin.js#L765
Attributes
chunk:Chunk
compilation:Compilation
Returns:Module[]

Gets modules in order.

cssModulesPlugin.getOrderedChunkCssModules(chunk, chunkGraph, compilation): CssModule[]
Source Code: lib/css/CssModulesPlugin.js#L912
Attributes
chunk:Chunk
chunkGraph:ChunkGraph
compilation:Compilation
Returns:CssModule[]

Gets ordered chunk css modules.

cssModulesPlugin.renderChunk(__namedParameters, hooks): Source
Source Code: lib/css/CssModulesPlugin.js#L1096
Attributes
hooks:Object
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>
Returns:Source

Renders generated source.

CssModulesPlugin.chunkHasCss(chunk, chunkGraph): boolean
Source Code: lib/css/CssModulesPlugin.js#L1185
Attributes
chunk:Chunk
chunkGraph:ChunkGraph
Returns:boolean

Returns true, when the chunk has css.

CssModulesPlugin.getChunkFilenameTemplate(chunk, outputOptions): ChunkFilenameTemplate
Source Code: lib/css/CssModulesPlugin.js#L1170
Attributes

Gets chunk filename template.

CssModulesPlugin.renderModule(module, renderContext, hooks): Source | null
Source Code: lib/css/CssModulesPlugin.js#L987
Attributes
module:CssModule
hooks:Object
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>
Returns:Source | null

Renders css module source.