Skip to content

Commit c4e01dc

Browse files
CyberAPStanislav Lashmanov
andauthored
feat(build): provide names for asset entrypoints (#19912)
Co-authored-by: Stanislav Lashmanov <[email protected]>
1 parent 6eaccc9 commit c4e01dc

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/vite/src/node/plugins/manifest.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export interface ManifestChunk {
2121
assets?: string[]
2222
isEntry?: boolean
2323
name?: string
24+
names?: string[]
2425
isDynamicEntry?: boolean
2526
imports?: string[]
2627
dynamicImports?: string[]
@@ -127,7 +128,10 @@ export function manifestPlugin(): Plugin {
127128
file: asset.fileName,
128129
src,
129130
}
130-
if (isEntry) manifestChunk.isEntry = true
131+
if (isEntry) {
132+
manifestChunk.isEntry = true
133+
manifestChunk.names = asset.names
134+
}
131135
return manifestChunk
132136
}
133137

playground/backend-integration/__tests__/backend-integration.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ describe.runIf(isBuild)('build', () => {
7575
expect(dirFooAssetEntry).not.toBeUndefined() // '\\' should not be used even on windows
7676
// use the entry name
7777
expect(dirFooAssetEntry.file).toMatch('assets/bar-')
78+
expect(dirFooAssetEntry.names).toStrictEqual(['bar.css'])
7879
expect(iconEntrypointEntry?.file).not.toBeUndefined()
7980
expect(waterContainerEntry?.file).not.toBeUndefined()
8081
})

0 commit comments

Comments
 (0)