* Generate CSS source for the current module * @param {NormalModule} module the module to generate CSS source for * @param {GenerateContext} generateContext the generate context * @returns {Source | null} the CSS source
(module, generateContext)
| 853 | * @returns {Source | null} the CSS source |
| 854 | */ |
| 855 | _renderCss(module, generateContext) { |
| 856 | const moduleSourceContent = /** @type {Source} */ ( |
| 857 | this.generate(module, { |
| 858 | ...generateContext, |
| 859 | type: CSS_TYPE |
| 860 | }) |
| 861 | ); |
| 862 | |
| 863 | if (!moduleSourceContent) { |
| 864 | return null; |
| 865 | } |
| 866 | |
| 867 | const compilation = generateContext.runtimeTemplate.compilation; |
| 868 | const undoPath = ""; |
| 869 | |
| 870 | const CssModulesPlugin = getCssModulesPlugin(); |
| 871 | const hooks = CssModulesPlugin.getCompilationHooks(compilation); |
| 872 | return CssModulesPlugin.renderModule( |
| 873 | /** @type {CssModule} */ (module), |
| 874 | { |
| 875 | undoPath, |
| 876 | moduleSourceContent, |
| 877 | moduleFactoryCache: this._moduleFactoryCache, |
| 878 | runtimeTemplate: generateContext.runtimeTemplate |
| 879 | }, |
| 880 | hooks |
| 881 | ); |
| 882 | } |
| 883 | |
| 884 | /** |
| 885 | * Convert a CSS Source into a JS string literal, splicing `__webpack_require__.h()` for `[fullhash]` placeholders. |
no test coverage detected