Interesting work by Evan Wallace, a JS bundler/minifier written in Go. Since it compiles down to native code, it’s fast:
It supports quite a lot of stuff, but is not considered to cover it all:
This is a hobby project that I wrote over the 2019-2020 winter break. I believe that it’s relatively complete and functional. However, it’s brand new code and probably has a lot of bugs. It also hasn’t yet been used in production by anyone. Use at your own risk.
# Produces dist/entry_point.js and dist/entry_point.js.map esbuild --bundle entry_point.js --outdir=dist --minify --sourcemap
Also works with React, with some extra CLI arguments:
esbuild example.jsx --bundle '--define:process.env.NODE_ENV="production"' --minify --outfile=out.js