-
Notifications
You must be signed in to change notification settings - Fork 700
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Reproduction link or steps
// main.js
export * from "x"// rolldown.config.mjs
export default {
input: './main.js',
external: ['x']
}What is expected?
Output should just be
export * from "x"What is actually happening?
Output includes tons of unnecessary code:
import "x";
export * from "x"
//#region rolldown:runtime
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
key = keys[i];
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
get: ((k) => from[k]).bind(null, key),
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
return to;
};
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
//#endregion
//#region main.js
var main_ns = {};
import * as import_x from "x";
__reExport(main_ns, import_x);
//#endregionMost importantly, the line import * as import_x from "x"; completely breaks treeshaking for any module that imports this one.
System Info
rolldown@nightly (0.12.2-snapshot-a2bb2ca-20240811003152)Any additional comments?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working