new CssModulesPlugin(): CssModulesPluginReturns:
CssModulesPluginapply(compiler): voidAttributes
Applies the plugin by registering its hooks on the compiler.
getModulesInOrder(chunk, modules, compilation): Module[]Attributes
Gets modules in order.
getOrderedChunkCssModules(chunk, chunkGraph, compilation): CssModule[]Attributes
chunk:
Chunkchunk
chunkGraph:
ChunkGraphchunk graph
compilation:
Compilationcompilation
Returns:
CssModule[]ordered css modules
Gets ordered chunk css modules.
renderChunk(renderContextCssModulesPlugin, hooks): SourceAttributes
Renders generated source.
Attributes
Returns true, when the chunk has css.
Attributes
chunk:
Chunkchunk
outputOptions:
OutputNormalizedWithDefaultsoutput options
Returns:
ChunkFilenameTemplateused filename template
Gets chunk filename template.
Attributes
compilation:
Compilationthe compilation
Returns:
CompilationHooksCssModulesPluginthe attached hooks
Returns the attached hooks.
Attributes
module:
CssModulecss module
renderContext:
ChunkRenderContextCssModulesPluginoptions object
hooks
Returns:
Source | nullcss module source
Renders css module source.
Attributes
chunk:
Chunkthe chunk
chunkGraph:
ChunkGraphthe chunk graph
codeGenerationResults:
CodeGenerationResultsresults of code generation
hash:
stringcompilation hash
moduleFactoryCache:
WeakMap<Source, ModuleFactoryCacheEntry>moduleFactoryCache
moduleSourceContent:
Sourcecontent
runtimeTemplate:
RuntimeTemplatethe runtime template
undoPath:
stringundo path to css file
Attributes
chunkHash:
SyncHook<[Chunk, Hash, ChunkHashContext]>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 defaultrenderModulePackage:
SyncWaterfallHook<[Source, Module, ChunkRenderContextCssModulesPlugin], Source>Attributes
Attributes
chunk:
Chunkthe chunk
chunkGraph:
ChunkGraphthe chunk graph
codeGenerationResults:
CodeGenerationResultsresults of code generation
hash:
stringcompilation hash
modules:
CssModule[]modules
runtimeTemplate:
RuntimeTemplatethe runtime template
undoPath:
stringundo path to css file
uniqueName:
stringthe unique name