Skip to content

Minified line lengths #3170

Closed
Closed
@jawj

Description

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:

  • Always emit \n instead of ; when the effect is the same (keeps output size constant)
  • Emit a \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?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions