@@ -195,73 +195,73 @@ class MiniCssExtractPlugin {
195
195
compilation . mainTemplate . hooks . renderManifest . tap (
196
196
pluginName ,
197
197
( result , { chunk } ) => {
198
- for ( const theme of this . themes ) {
199
- const renderedModules = Array . from ( chunk . modulesIterable ) . filter (
200
- ( module ) => module . type === MODULE_TYPE && module . theme === theme
201
- ) ;
198
+ for ( const theme of this . themes ) {
199
+ const renderedModules = Array . from ( chunk . modulesIterable ) . filter (
200
+ ( module ) => module . type === MODULE_TYPE && module . theme === theme
201
+ ) ;
202
202
203
- if ( renderedModules . length > 0 ) {
204
- result . push ( {
205
- render : ( ) =>
206
- this . renderContentAsset (
207
- compilation ,
208
- chunk ,
209
- renderedModules ,
210
- compilation . runtimeTemplate . requestShortener
211
- ) ,
212
- filenameTemplate : ( { chunk : chunkData } ) => {
213
- return theme === 'default'
214
- ? this . options . moduleFilename ( chunkData )
215
- : this . options . themeModuleFilename ( theme ) ;
216
- } ,
217
- pathOptions : {
203
+ if ( renderedModules . length > 0 ) {
204
+ result . push ( {
205
+ render : ( ) =>
206
+ this . renderContentAsset (
207
+ compilation ,
218
208
chunk ,
219
- contentHashType : MODULE_TYPE ,
220
- } ,
221
- identifier :
222
- theme !== 'default'
223
- ? `${ pluginName } .theme.${ chunk . id } `
224
- : `${ pluginName } .${ chunk . id } ` ,
225
- hash : chunk . contentHash [ MODULE_TYPE ] ,
226
- } ) ;
227
- }
209
+ renderedModules ,
210
+ compilation . runtimeTemplate . requestShortener
211
+ ) ,
212
+ filenameTemplate : ( { chunk : chunkData } ) => {
213
+ return theme === 'default'
214
+ ? this . options . moduleFilename ( chunkData )
215
+ : this . options . themeModuleFilename ( theme ) ;
216
+ } ,
217
+ pathOptions : {
218
+ chunk,
219
+ contentHashType : MODULE_TYPE ,
220
+ } ,
221
+ identifier :
222
+ theme !== 'default'
223
+ ? `${ pluginName } .theme.${ chunk . id } `
224
+ : `${ pluginName } .${ chunk . id } ` ,
225
+ hash : chunk . contentHash [ MODULE_TYPE ] ,
226
+ } ) ;
228
227
}
229
228
}
229
+ }
230
230
) ;
231
231
232
232
compilation . chunkTemplate . hooks . renderManifest . tap (
233
233
pluginName ,
234
234
( result , { chunk } ) => {
235
- for ( const theme of this . themes ) {
236
- const renderedModules = Array . from ( chunk . modulesIterable ) . filter (
237
- ( module ) => module . type === MODULE_TYPE && module . theme === theme
238
- ) ;
239
- if ( renderedModules . length > 0 ) {
240
- result . push ( {
241
- render : ( ) =>
242
- this . renderContentAsset (
243
- compilation ,
244
- chunk ,
245
- renderedModules ,
246
- compilation . runtimeTemplate . requestShortener
247
- ) ,
248
- filenameTemplate :
249
- theme === 'default'
250
- ? this . options . chunkFilename
251
- : `theme-${ theme } -${ this . options . chunkFilename } ` ,
252
- pathOptions : {
235
+ for ( const theme of this . themes ) {
236
+ const renderedModules = Array . from ( chunk . modulesIterable ) . filter (
237
+ ( module ) => module . type === MODULE_TYPE && module . theme === theme
238
+ ) ;
239
+ if ( renderedModules . length > 0 ) {
240
+ result . push ( {
241
+ render : ( ) =>
242
+ this . renderContentAsset (
243
+ compilation ,
253
244
chunk ,
254
- contentHashType : MODULE_TYPE ,
255
- } ,
256
- identifier :
257
- theme !== 'default'
258
- ? `${ pluginName } .${ theme } .${ chunk . id } `
259
- : `${ pluginName } .${ chunk . id } ` ,
260
- hash : chunk . contentHash [ MODULE_TYPE ] ,
261
- } ) ;
262
- }
245
+ renderedModules ,
246
+ compilation . runtimeTemplate . requestShortener
247
+ ) ,
248
+ filenameTemplate :
249
+ theme === 'default'
250
+ ? this . options . chunkFilename
251
+ : `theme-${ theme } -${ this . options . chunkFilename } ` ,
252
+ pathOptions : {
253
+ chunk,
254
+ contentHashType : MODULE_TYPE ,
255
+ } ,
256
+ identifier :
257
+ theme !== 'default'
258
+ ? `${ pluginName } .${ theme } .${ chunk . id } `
259
+ : `${ pluginName } .${ chunk . id } ` ,
260
+ hash : chunk . contentHash [ MODULE_TYPE ] ,
261
+ } ) ;
263
262
}
264
263
}
264
+ }
265
265
) ;
266
266
267
267
compilation . mainTemplate . hooks . hashForChunk . tap (
0 commit comments