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
Minified line lengths #3170
Comments
I’m looking at what other tools do. Terser and UglifyJS seem to have a It would be nice to not have the size be any bigger, in which case this could happen automatically. Computing whether it’s safe to omit a semicolon is somewhat complicated both because the printer doesn’t necessarily know what will be printed next, and because going back and changing a semicolon to a newline messes up source map generation. Note to self: I’ll try to think of a way of doing this. Maybe |
Many thanks for the quick reply @evanw (and many thanks for esbuild too, of course)! I look forward to seeing what you come up with. |
I looked into this a bit. Relying on ASI is possible but hurts gzip size, so it's probably not something that would be turned on by default. |
I bundle a library using esbuild with
--minify
. Most of the minified code is in lines of >30,000 characters.When the library throws an Error, the stack trace includes a code excerpt, which I think must be defined as a specific number of lines. This means that users have to scroll back up a very long way to find the error message.
I'd like to keep minifying the library, but it would be great if there was an option to emit shorter lines. Two possibilities that come to mind:
\n
instead of;
when the effect is the same (keeps output size constant)\n
after a;
if there hasn't been one for the last N characters (potentially simpler to implement)Is either of these (or something else) a possibility?
The text was updated successfully, but these errors were encountered: