On 30th of August new major update of Webpacker was released. There are two big changes:
Webpacker 3.0: No separate process needed, less config generated https://t.co/SKZZsJgLIL
— DHH (@dhh) 30 августа 2017 г.
Two major features:
- separate process is no longer needed in development
- the vast majority of the config now lives in the Webpacker npm package, so your config/ directory stays clean and updates are much easier.
Now Webpacker compiles on-demand in development as well as testing. Developers done a lot of work to speed up this process, and for lots of apps, the performance will be increased. But if you have big app or you would lie reloading or hot module replacements, you can still use the bin/webpacker-dev-server. Webpacker will automatically detect if this process is running and start serving packs from there rather than on-demand.
Developers also cut down on the amount of config boilerplate that’s generated in the Rails config/ directory. All the standard stuff is now inside the Webpacker npm module, which makes upgrading so much easier. And you can still overwrite any of the defaults as you please.
This follows from a large refactoring of the Webpacker internals. Gone are the many individual singletons, replaced by a single top-level singleton that just aggregates a normal set of classes for configuration, compilation, and so on.