Webpacker to jsbundling-rails/cssbundling-rails Migration
Webpacker was retired by the Rails core team and no longer receives updates. Projects still running it are stuck on old Webpack tooling and drifting further from a supported setup every day. We have migrated several Rails projects off Webpacker onto jsbundling-rails and cssbundling-rails.
Why move off Webpacker?
- Webpacker is unmaintained - no fixes for bugs or security issues
- jsbundling-rails and cssbundling-rails let you use current esbuild, Webpack, or Rollup, and current Sass/PostCSS/Tailwind tooling directly
- Simpler, smaller asset pipeline with fewer Rails-specific abstractions to fight
- Keeps the project compatible with current and future Rails releases
What the migration involves
- Replacing Webpacker with jsbundling-rails for JavaScript
- Replacing Webpacker’s Sass/CSS handling with cssbundling-rails
- Removing sprockets-rails where it is no longer needed
- Rewiring asset tags, manifests, and import paths that Webpacker generated automatically
- Verifying the frontend build and asset output through Continuous Integration before it ships via Continuous Delivery
From experience
We have written up both sides of this migration in detail:
- Howto migrate from Webpacker to jsbundling-rails in Ruby on Rails
- Howto migrate from Webpacker to cssbundling-rails in Ruby on Rails for CSS
- Howto remove sprockets-rails from your Ruby on Rails project
- Analyzing SassC::SyntaxError in Ruby on Rails 7.0
Summary
Webpacker won’t get safer or faster by staying on it. We move projects to jsbundling-rails and cssbundling-rails with the frontend build and asset output verified at every step, so the site looks and behaves exactly the same
- just on tooling that is still maintained.
Still running Webpacker? Get in touch.