-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
Rollup Version
4.41.1
Operating System (or Browser)
MacOS
Node Version (if applicable)
No response
Link To Reproduction
Expected Behaviour
related: nuxt/nuxt#32175
we have a two stage build, and the first rollup build produces code like this (which I've cleaned up for the reproduction):
// entry
import("./root.js")
.then(function(mod) {
return mod.mod;
})
.then((m) => m.default || m)
// root.js
const defaultExport = 'defaultExport'
const namedExport = 'namedExport'
const mod = {
default: defaultExport
}
export {
mod,
namedExport
};I would expect the default export to be preserved.
Note that this is only with inline function vs arrow function. .then(mod => mod.mod) works fine
Actual Behaviour
Upon being transformed a second time by rollup, the export is annulled:
Promise.resolve().then(function () { return root; })
.then(function(mod) {
return mod.mod;
})
.then((m) => m.default || m);
var root = /*#__PURE__*/Object.freeze({
__proto__: null
});Reactions are currently unavailable