Skip to content

feat(build): provide names for asset entrypoints #19912

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/vite/src/node/plugins/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface ManifestChunk {
assets?: string[]
isEntry?: boolean
name?: string
names?: string[]
isDynamicEntry?: boolean
imports?: string[]
dynamicImports?: string[]
Expand Down Expand Up @@ -127,7 +128,10 @@ export function manifestPlugin(): Plugin {
file: asset.fileName,
src,
}
if (isEntry) manifestChunk.isEntry = true
if (isEntry) {
manifestChunk.isEntry = true
manifestChunk.names = asset.names
}
return manifestChunk
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ describe.runIf(isBuild)('build', () => {
expect(dirFooAssetEntry).not.toBeUndefined() // '\\' should not be used even on windows
// use the entry name
expect(dirFooAssetEntry.file).toMatch('assets/bar-')
expect(dirFooAssetEntry.names).toStrictEqual(['bar.css'])
expect(iconEntrypointEntry?.file).not.toBeUndefined()
expect(waterContainerEntry?.file).not.toBeUndefined()
})
Expand Down