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

[BUG] import <default>, * as <ns> from 'module-marked-as-external' generates wrong code #446

Closed
shrinktofit opened this issue Oct 9, 2020 · 1 comment

Comments

@shrinktofit
Copy link

Source:

// index.js
import AmmoClosure, * as AmmoJs from "@cocos/ammo";
console.log(AmmoClosure, AmmoJs);

Config:

// Version 0.7.13
const esbuild = require('esbuild');
(async () => {
	await esbuild.build({
		bundle: true,
        entryPoints: ['./index.js'],
		splitting: true,
		outdir: './out',
		format: 'esm',
		external: ['@cocos/ammo'],
	});
})();

Generated:

import AmmoClosure, {
  default as AmmoClosure // Repetition name `AmmoClosure`
}, * as AmmoJs from "@cocos/ammo";
console.log(AmmoClosure, AmmoJs);
@evanw evanw closed this as completed in 4356e31 Oct 10, 2020
@evanw
Copy link
Owner

evanw commented Oct 10, 2020

Thanks for reporting this. I’m surprised this hasn’t come up yet. This should be fixed in version 0.7.14.

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