A reason-native javascript bundler 🏎

2018 January 12

I did some benchmarking, compiling gravitron, and was pretty fast πŸ˜„

  • webpack (no pre/post-processing, simplest config) - 1.25s
  • parcel (no cache, no minify) - 3.0s
  • - 0.2s πŸš€

That's 6-10x faster! (Note: webpack & parcel have tons more features, and probably still has some bugs)

Also of note:

  • time node -e 'console.log("hi")' - 0.3s πŸ™ƒ

2018 January 11

I was working on reprocessing-scripts, and I didn't want to have to depend on some huuge javascript bundler w/ all of their dependencies (webpack's node_modules is 50megs, parcel's node_modules is 150megs), so I figured I'd try making a reason-native bundler.

I repurposed flow's javascript parser, inspired by jeason, and figured out the node resolution algorithm, and it wasn't too much work after that.

I also managed to get hot-reloading working! I added a --external-everything flag which creates a bundle that only contains the files in your project, and no external dependencies. It expects them to already have been loaded on the page by a previous bundle.