Skip to content
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

Odd output for circular reference code splitting #251

Closed
guybedford opened this issue Jul 11, 2020 · 1 comment
Closed

Odd output for circular reference code splitting #251

guybedford opened this issue Jul 11, 2020 · 1 comment

Comments

@guybedford
Copy link
Contributor

a.js

export * from './b.js';
export var p = 5;

b.js

export * from './a.js';
export var q = 6;

when bundling with:

./esbuild --splitting a.js b.js --outdir=out --format=esm --bundle

I'm getting an output for a looking like:

// a.js
export {
  p,
  q
};

with no definition of p or q.

@evanw
Copy link
Owner

evanw commented Jul 12, 2020

That's strange. There is indeed a bug here, but I'm getting a different output. Here's what I see:

import {
  p
} from "./chunk.js";

// a.js
export {
  p,
  q
};

So p is defined at least (esbuild version 0.6.1). The missing import for q is still a bug of course. I'll work on fixing that. Thanks so much for reporting this.

@evanw evanw closed this as completed in 6d4cae0 Jul 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants