@@ -122,25 +122,25 @@ export function manifestPlugin(): Plugin {
122
122
function createAsset (
123
123
asset : OutputAsset ,
124
124
src : string ,
125
- isEntry ?: boolean ,
125
+ name ?: string ,
126
126
) : ManifestChunk {
127
127
const manifestChunk : ManifestChunk = {
128
128
file : asset . fileName ,
129
129
src,
130
130
}
131
- if ( isEntry ) {
131
+ if ( name ) {
132
132
manifestChunk . isEntry = true
133
- manifestChunk . names = asset . names
133
+ manifestChunk . name = name
134
134
}
135
135
return manifestChunk
136
136
}
137
137
138
138
const entryCssReferenceIds = cssEntriesMap . get ( this . environment ) !
139
- const entryCssAssetFileNames = new Set ( )
140
- for ( const id of entryCssReferenceIds ) {
139
+ const entryCssAssetFileNames = new Map ( )
140
+ for ( const [ name , id ] of entryCssReferenceIds ) {
141
141
try {
142
142
const fileName = this . getFileName ( id )
143
- entryCssAssetFileNames . add ( fileName )
143
+ entryCssAssetFileNames . set ( fileName , name )
144
144
} catch {
145
145
// The asset was generated as part of a different output option.
146
146
// It was already handled during the previous run of this plugin.
@@ -157,8 +157,8 @@ export function manifestPlugin(): Plugin {
157
157
chunk . originalFileNames . length > 0
158
158
? chunk . originalFileNames [ 0 ]
159
159
: `_${ path . basename ( chunk . fileName ) } `
160
- const isEntry = entryCssAssetFileNames . has ( chunk . fileName )
161
- const asset = createAsset ( chunk , src , isEntry )
160
+ const name = entryCssAssetFileNames . get ( chunk . fileName )
161
+ const asset = createAsset ( chunk , src , name )
162
162
163
163
// If JS chunk and asset chunk are both generated from the same source file,
164
164
// prioritize JS chunk as it contains more information
0 commit comments