-
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
const is replaced by var #623
Comments
This is because in Safari declarations with |
There are also some other reasons, which are described here: #598 (comment). |
@remorses Not really. I assume only top level const/let are replaced with var? Maybe an option to enable/disable this behavior. |
As mentioned above, this behavior is deliberate and is done for at least three reasons. It sounds like you don’t have a reason you need to keep |
Sure. I understand. You can close this thread. I don't mind if it's using var on top level. It just looked weird when I saw it the first time, but I read your comment on the other thread and made more sense. |
I use the following command
esbuild src/main.js --bundle --format=esm --target=es2020 --outfile=out.js
const v1 = a;
is replaced withvar v1 = a;
Is there an option to keep const instead of var?
The text was updated successfully, but these errors were encountered: