* Generate JS expressions for `@import` side effects (`style` exportType only). * @param {NormalModule} module the module to generate CSS text for * @param {GenerateContext} generateContext the generate context * @returns {string[]} JS expressions, one per `@import` dependency
(module, generateContext)
| 781 | * @returns {string[]} JS expressions, one per `@import` dependency |
| 782 | */ |
| 783 | _generateImportExpressions(module, generateContext) { |
| 784 | const { moduleGraph, concatenationScope } = generateContext; |
| 785 | const parts = []; |
| 786 | |
| 787 | for (const dep of module.dependencies) { |
| 788 | if (!(dep instanceof CssImportDependency)) continue; |
| 789 | const depModule = /** @type {CssModule} */ (moduleGraph.getModule(dep)); |
| 790 | if (concatenationScope && concatenationScope.isModuleInScope(depModule)) { |
| 791 | continue; |
| 792 | } |
| 793 | parts.push( |
| 794 | generateContext.runtimeTemplate.moduleExports({ |
| 795 | module: depModule, |
| 796 | chunkGraph: generateContext.chunkGraph, |
| 797 | request: depModule.userRequest, |
| 798 | weak: false, |
| 799 | runtimeRequirements: generateContext.runtimeRequirements |
| 800 | }) |
| 801 | ); |
| 802 | } |
| 803 | |
| 804 | return parts; |
| 805 | } |
| 806 | |
| 807 | /** |
| 808 | * Recursively merge `@import`'d CSS into a single Source (text/css-style-sheet only). |
no test coverage detected