-
Notifications
You must be signed in to change notification settings - Fork 458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Align module order with esbuild when mixed load esm
and cjs
modules.
#1740
Comments
IWANABETHATGUY
changed the title
Normalize the order of performing CodeGen.
Align module order with esbuild whem mixed load **esm** and **cjs** module.
Jul 28, 2024
more generate case: // index.js
import {a} from './a.js'
import {b} from './b.js'
console.log(a, b, c);
// a.js
export const a = 1000;
// b.js
export const b = 10000; rolldown //#region a.js
const a = 1000;
//#endregion
//#region b.js
const b = 10000;
//#endregion
//#region index.js
console.log(a, b, c);
//#endregion esbuild // a.js
var a = 1e3;
// b.js
var b = 1e4;
// entry.js
console.log(a, b, c); Mixed cjs and esm// index.js
const a = require('./a.js')
import {b} from './b.js'
console.log(b, a);
// a.js
export const a = 1000;
// b.js
export const b = 10000; rolldown // ...snip runtime
//#endregion
//#region b.js
const b = 10000;
//#endregion
//#region a.js
var a_ns, a$1;
var init_a = __esmMin(() => {
a_ns = {};
__export(a_ns, {a: () => a$1});
a$1 = 1000;
});
//#endregion
//#region index.js
const a = (init_a(), __toCommonJS(a_ns));
console.log(b, a);
//#endregion esbuild // a.js
var a_exports = {};
__export(a_exports, {
a: () => a
});
var a;
var init_a = __esm({
"a.js"() {
a = 1e3;
}
});
// b.js
var b = 1e4;
// entry.js
var a2 = (init_a(), __toCommonJS(a_exports));
console.log(a2, b, c); |
IWANABETHATGUY
changed the title
Align module order with esbuild whem mixed load **esm** and **cjs** module.
Align module order with esbuild whem mixed load Jul 28, 2024
esm
and cjs
module.
7086cmd
changed the title
Align module order with esbuild whem mixed load
Align module order with esbuild when mixed load Aug 13, 2024
esm
and cjs
module.esm
and cjs
modules.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
you could open an issue to track, it is not related to dataurl encoding.
Originally posted by @IWANABETHATGUY in #1729 (comment)
The text was updated successfully, but these errors were encountered: