Skip to content

Esbuild doesn't minify assets by default #3405

@murny

Description

@murny

One little change from moving from webpack to esbuild, is the fact that esbuild doesn't minify assets by default?

It's not a huge issue, but asset sizes have gone up a little as a result in production:

  • application.css went from ~270KB to ~335KB
  • application.js went from ~800KB to ~1.6 MB
  • admin.js went from ~95KB to ~7KB (this is more to do with webpack and how they are rebundling all the libraries again in the separate packs. ESbuild doesn't do this, hence the massive savings.)

This should be a simple fix (think it just needs a --minify flag), but requires some investigation on the best way to do this.

More info: https://github.com/rails/jsbundling-rails/wiki#different-builds-for-production-and-developmenttest-environments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions