What problem does this feature solve?
When an module is imported statically, dynamic imports to that module can be inlined.
For example of https://stackblitz.com/edit/rolldown-rolldown-starter-stackblitz-5krehyfj?file=src%2Fentry.js,src%2Ffoo.js , the output can be:
const foo = "foo";
var foo$1 = /*#__PURE__*/Object.freeze({
__proto__: null,
foo: foo,
[Symbol.toStringTag]: 'Module'
});
console.log(foo);
Promise.resolve().then(function () { return foo$1; }).then(mod => console.log(mod.foo));
This is what rollup does (repl).
refs #4904
What does the proposed API look like?
Not an API change