-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
feat!: set esbuild default charset to utf8 #10753
Conversation
@@ -375,6 +375,7 @@ export function resolveEsbuildTranspileOptions( | |||
return { | |||
...options, | |||
minify: true, | |||
charset: 'utf8', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think charset
should be moved up to the definition of options
so we have consistent usage of utf8
by default. We also need to define it before the esbuildOptions
spread so the user can overwrite it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
9e67fe5
to
b6878cf
Compare
Is this only for v4 ? Because I get the exact same error in version |
Yes, this is only for v4. |
I tried to upgrade to v4 but i encountered many other problems because of other packages that do not support v4. Are you planing on fixing this for v3 too? This problem happened to me today suddenly. |
@samyarkd I suggest you still try to upgrade to v4, but if you need to stay in v3, you should be able to set |
Currently, if I use a language other than English in my javascript code, my bundle gets very large. To avoid this, I have to use a Terser. For example, Terser preserves "丂", but esbuild seems to convert it to "\u4E02".
In order to solve the problem and start using esbuild without fear, we need to add charset.