new CssModulesPlugin(): CssModulesPlugin
Returns:
CssModulesPluginCssModulesPlugin.getCompilationHooks(compilation): { chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>; orderModules: SyncBailHook<[Chunk, Module[], Compilation], void | Module[] | undefined>; renderModulePackage: SyncWaterfallHook<[Source, Module, ChunkRenderContextCssModulesPlugin], Source> }
Attributes
compilation:
CompilationReturns:
{ chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>; orderModules: SyncBailHook<[Chunk, Module[], Compilation], void | Module[] | undefined>; renderModulePackage: SyncWaterfallHook<[Source, Module, ChunkRenderContextCssModulesPlugin], Source> }cssModulesPlugin.apply(compiler): void
Attributes
compiler:
CompilerApplies the plugin by registering its hooks on the compiler.
cssModulesPlugin.getModulesInOrder(chunk, modules, compilation): Module[]
Attributes
Gets modules in order.
cssModulesPlugin.getOrderedChunkCssModules(chunk, chunkGraph, compilation): CssModule[]
Attributes
Gets ordered chunk css modules.
cssModulesPlugin.renderChunk(__namedParameters, hooks): Source
Attributes
__namedParameters:
RenderContextCssModulesPluginhooks:
ObjectchunkHash:
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 default.renderModulePackage:
SyncWaterfallHook<[Source, Module, ChunkRenderContextCssModulesPlugin], Source>Returns:
SourceRenders generated source.
CssModulesPlugin.chunkHasCss(chunk, chunkGraph): boolean
Attributes
Returns true, when the chunk has css.
CssModulesPlugin.getChunkFilenameTemplate(chunk, outputOptions): ChunkFilenameTemplate
Attributes
Gets chunk filename template.
CssModulesPlugin.renderModule(module, renderContext, hooks): Source | null
Attributes
module:
CssModulerenderContext:
ChunkRenderContextCssModulesPluginhooks:
ObjectchunkHash:
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 default.renderModulePackage:
SyncWaterfallHook<[Source, Module, ChunkRenderContextCssModulesPlugin], Source>Renders css module source.