rolldown icon indicating copy to clipboard operation
rolldown copied to clipboard

Align module order with esbuild when mixed load `esm` and `cjs` modules.

Open 7086cmd opened this issue 1 year ago • 1 comments

Not hurry to solve it, but this open for tracking it.

In Rolldown, the generated code order is firstly y that x.


Actually this is not same with esbuild:

TestLoaderDataURLCommonJSAndES6
---------- /out.js ----------
// x.txt
var require_x = __commonJS({
  "x.txt"(exports, module) {
    module.exports = "data:text/plain;charset=utf-8,x";
  }
});

// y.txt
var y_default = "data:text/plain;charset=utf-8,y";

// entry.js
var x_url = require_x();
console.log(x_url, y_default);

you could open an issue to track, it is not related to dataurl encoding.

Originally posted by @IWANABETHATGUY in https://github.com/rolldown/rolldown/pull/1729#discussion_r1691511202

7086cmd avatar Jul 26 '24 01:07 7086cmd