Skip to content

Commit e8ffe96

Browse files
hi-ogawaclaude
andcommitted
refactor(rsc): remove entryName from environment import metadata
Let Rollup auto-name emitted chunks instead of deriving entry names from specifiers. The actual output filename is tracked via generateBundle anyway, so the explicit name was unnecessary. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent f7c422e commit e8ffe96

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

packages/plugin-rsc/src/plugins/import-environment.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export type EnvironmentImportMeta = {
2121
targetEnv: string
2222
sourceEnv: string
2323
specifier: string
24-
entryName: string
2524
}
2625

2726
export function vitePluginImportEnvironment(
@@ -67,7 +66,6 @@ export function vitePluginImportEnvironment(
6766
this.emitFile({
6867
type: 'chunk',
6968
id: meta.resolvedId,
70-
name: meta.entryName,
7169
})
7270
}
7371
}
@@ -125,18 +123,13 @@ export function vitePluginImportEnvironment(
125123
resolvedId = resolved.id
126124
}
127125

128-
// TODO: shouldn't be necessary. replace with internal ID.
129-
// Derive entry name from specifier (e.g., './entry.ssr.tsx' -> 'entry.ssr')
130-
const entryName = deriveEntryName(specifier)
131-
132126
// Track discovered entry
133127
manager.environmentImportMetaMap[resolvedId] = {
134128
// TODO: relative-ize resolveId
135129
resolvedId,
136130
targetEnv: environmentName,
137131
sourceEnv: this.environment.name,
138132
specifier,
139-
entryName,
140133
}
141134

142135
let replacement: string
@@ -204,13 +197,3 @@ export function vitePluginImportEnvironment(
204197
),
205198
]
206199
}
207-
208-
function deriveEntryName(specifier: string): string {
209-
// Remove leading ./ or ../
210-
let name = specifier.replace(/^\.\.?\//, '')
211-
// Remove extension
212-
name = name.replace(/\.[^.]+$/, '')
213-
// Get basename if it's a path
214-
name = path.basename(name)
215-
return name
216-
}

0 commit comments

Comments
 (0)