File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1350,9 +1350,18 @@ function injectChunkMetadata(
1350
1350
chunkMetadataMap . set ( key , {
1351
1351
importedAssets : new Set ( ) ,
1352
1352
importedCss : new Set ( ) ,
1353
+ // NOTE: adding this as a workaround for now ideally we'd want to remove this workaround
1354
+ // use shared `chunk.modules` object
1355
+ // to allow mutation on js side plugins
1356
+ __modules : chunk . modules ,
1353
1357
} )
1354
1358
}
1355
1359
chunk . viteMetadata = chunkMetadataMap . get ( key )
1360
+ Object . defineProperty ( chunk , 'modules' , {
1361
+ get ( ) {
1362
+ return chunk . viteMetadata ! . __modules
1363
+ } ,
1364
+ } )
1356
1365
}
1357
1366
1358
1367
function injectEnvironmentInContext < Context extends MinimalPluginContext > (
Original file line number Diff line number Diff line change 1
1
export interface ChunkMetadata {
2
2
importedAssets : Set < string >
3
3
importedCss : Set < string >
4
+ __modules : any
4
5
}
5
6
6
7
declare module 'rolldown' {
You can’t perform that action at this time.
0 commit comments