Skip to content

[Bug]: entryFileNames Function parameter PreRenderedChunk.name is different from rollup #4790

@jevin98

Description

@jevin98

Reproduction link or steps

https://github.com/jevin98/rolldown-vite-preserveModulesRoot-test

What is expected?

step

git clone https://github.com/jevin98/rolldown-vite-preserveModulesRoot-test
pnpm install
pnpm build

If the vite version is normal and rollup is used, then the name in the entryFileNames parameter in rollup can output 'Button/index' normally.

{
  exports: [ 'default' ],
  facadeModuleId: 'C:/Users/PC/Desktop/module-test/src/components/Button/index.ts',
  isDynamicEntry: false,
  isEntry: false,
  isImplicitEntry: false,
  moduleIds: [ 'C:/Users/PC/Desktop/module-test/src/components/Button/index.ts' ],
  name: 'Button/index',
  type: 'chunk'
}

What is actually happening?

Using rolldown-vite, the final entryFileNames cannot be consistent with rollup

{
  name: 'index',
  isEntry: false,
  isDynamicEntry: true,
  facadeModuleId: 'C:/Users/PC/Desktop/module-test/src/components/Button/index.vue',
  moduleIds: [ 'C:/Users/PC/Desktop/module-test/src/components/Button/index.vue' ],
  exports: [ 'Button_default' ]
}

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-12500
    Memory: 9.54 GB / 31.69 GB
  Binaries:
    Node: 22.11.0 - C:\nvm4w\nodejs\node.EXE
    npm: 10.9.0 - C:\nvm4w\nodejs\npm.CMD
    pnpm: 10.11.0 - C:\nvm4w\nodejs\pnpm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.98)
    Internet Explorer: 11.0.22621.3527

Any additional comments?

Here I used preserveModules and preserveModulesRoot

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions