Skip to content

Commit a817307

Browse files
authored
build: remove hash from built filenames (#20946)
1 parent ef411ce commit a817307

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

packages/vite/rolldown.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const sharedNodeOptions = defineConfig({
5656
output: {
5757
dir: './dist',
5858
entryFileNames: `node/[name].js`,
59-
chunkFileNames: 'node/chunks/dep-[hash].js',
59+
chunkFileNames: 'node/chunks/[name].js',
6060
exports: 'named',
6161
format: 'esm',
6262
externalLiveBindings: false,

packages/vite/rolldown.dts.config.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export default defineConfig({
3939
},
4040
output: {
4141
dir: './dist/node',
42+
chunkFileNames: 'chunks/[name].d.ts',
4243
format: 'esm',
4344
},
4445
treeshake: {
@@ -138,8 +139,8 @@ function patchTypes(): Plugin {
138139
const importBindings = getAllImportBindings(ast)
139140
if (
140141
chunk.fileName.startsWith('module-runner') ||
141-
// index and moduleRunner have a common chunk "moduleRunnerTransport"
142-
chunk.fileName.startsWith('moduleRunnerTransport') ||
142+
// index and moduleRunner have a common chunk
143+
chunk.fileName.startsWith('chunks/') ||
143144
chunk.fileName.startsWith('types.d-')
144145
) {
145146
validateRunnerChunk.call(this, chunk, importBindings)
@@ -211,8 +212,8 @@ function validateRunnerChunk(
211212
!id.startsWith('./') &&
212213
!id.startsWith('../') &&
213214
!id.startsWith('#') &&
214-
// index and moduleRunner have a common chunk "moduleRunnerTransport"
215-
!id.startsWith('moduleRunnerTransport.d') &&
215+
// index and moduleRunner have a common chunk
216+
!id.startsWith('chunks/') &&
216217
!id.startsWith('types.d')
217218
) {
218219
this.warn(
@@ -240,8 +241,8 @@ function validateChunkImports(
240241
!id.startsWith('node:') &&
241242
!id.startsWith('types.d') &&
242243
!id.startsWith('vite/') &&
243-
// index and moduleRunner have a common chunk "moduleRunnerTransport"
244-
!id.startsWith('moduleRunnerTransport.d') &&
244+
// index and moduleRunner have a common chunk
245+
!id.startsWith('chunks/') &&
245246
!deps.includes(id) &&
246247
!deps.some((name) => id.startsWith(name + '/'))
247248
) {

0 commit comments

Comments
 (0)