-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Leaking global 'exports' variable #165
Comments
I should clarify that unlike the other issue I filed, I have actually confirmed this with 0.4.3! Also, to reproduce:
With index.js as:
Only happens when passing |
This happens because esbuild supports CommonJS, which declares an implicit variable called
Can you share more information about what you are trying to do? What does your full file look like? |
I'm building a browser bundle, everything is is an es6 module--no commonjs or amd. I'm targeting esnext. There are a few hundred modules, it just so happened that there were a couple declaring It was no problem for me to change once I realized what was going on, just surprising to see a collision with a non-reserved word (at least in ecmascript) that is private to a module. I normally use rollup (& terser), but esbuild gets me from ~1 minute build time to less than a second, which is amazing. |
If I declare
const exports = ...
in an entry point or any included modules I get the following error:Is this intentional for one of the non-es module specs? It looks like it might have something to do with the runtime.
(As an aside, it would be nice to have the option to build without the runtime if it's not needed.)
Heres a trivial example of the runtime that gets generated when I remove the collision by hand. It seems like
exports = module.exports;
could be related.The text was updated successfully, but these errors were encountered: