-
Notifications
You must be signed in to change notification settings - Fork 698
Description
Reproduction link or steps
rolldown produces unnecessary facade chunks, which causes extra round trips and therefore severely impacts startup time.
in the repro, run vite build. It creates 2 files with counter in the name, and one of them is a facade chunk.
(relevant code:
{
name: 'signature',
enforce: 'pre',
resolveId: {
order: 'pre',
async handler(id, imp) {
if (id === './counter.js') {
console.log('turning counter into a chunk');
const result = await this.resolve(id, imp, { skipSelf: true });
if (result) {
this.emitFile({
id: result.id,
type: 'chunk',
preserveSignature: 'allow-extension',
});
}
return result;
}
},
},
})
What is expected?
Facades are only created when needed
What is actually happening?
Any entry gets a facade
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 20.19.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
rolldown-vite: 7.1.2Any additional comments?
See rollup/rollup#5891 for how this was solved in rollup.
Reactions are currently unavailable