Discussed in #8505
Originally posted by victordidenko March 1, 2026
Or am I misunderstood it?
Code
export const x = 1
export function y() {
let x = {}
x.a = 1
return x
}
with config
export default {
output: {
topLevelVar: true,
},
}
generates
//#region index.js
const x = 1;
function y() {
let x = {};
x.a = 1;
return x;
}
//#endregion
export { x, y };
(repl)