0.37
The project is in a healthy, maintained state
Use webpack to manage app-like JavaScript modules in Rails
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

Runtime

 Project Readme

Shakapacker: Rails asset bundling with modern build systems

Shakapacker (v10)

Shakapacker is the official, actively maintained successor to rails/webpacker. It gives Rails apps a manifest-backed bridge to webpack 5 or Rspack, with view helpers, installer tasks, binstubs, and configuration conventions that still allow direct bundler customization.

Shakapacker 10 supports Rspack β€” up to 17x faster than webpack per upstream benchmarks.

The canonical markdown source stays in this repository's docs/ directory and is published to the docs site.

Read the Shakapacker documentation at shakapacker.com

Ruby based checks Node based checks Generator specs Test Both Bundlers

node.js shakapacker gem version shakapacker npm package version shakapacker-webpack npm package version shakapacker-rspack npm package version

Documentation

Full documentation lives at shakapacker.com/docs. Start here:

Need Link
Decide if Shakapacker + Rspack is right Why Shakapacker with Rspack
Install Shakapacker Installation
Configure config/shakapacker.yml Configuration
Use the JavaScript/Node API Node Package API
Render assets with view helpers API Reference
Add React, TypeScript, or CSS React & integrations
Move from webpack to Rspack Rspack Migration
Compare generated webpack/Rspack configs Config Diff
Deploy compiled assets Deployment
Upgrade an existing app Common Upgrades
Troubleshoot builds Troubleshooting
Review releases Changelog

Why Shakapacker

  • Rails-native manifest integration and view helpers for bundled assets.
  • Support for webpack 5 and first-class Rspack builds.
  • JavaScript and TypeScript transpilation through SWC, Babel, or esbuild.
  • Development binstubs for watch mode and the webpack dev server.
  • Code splitting, HMR, CDN asset hosts, Subresource Integrity, and HTTP 103 Early Hints support.
  • Compatibility with npm, Yarn, pnpm, and Bun.
  • Optional shakapacker-webpack and shakapacker-rspack packages in 10.1+ that consolidate the managed bundler stack into one dependency.

Optional support

Optional integrations require extra packages only when you use them: React, TypeScript, stylesheets with Sass, Less, Stylus, CSS, PostCSS, and CoffeeScript.

For why you might choose this stack over importmaps, jsbundling-rails, or vite-rails, see Why Shakapacker with Rspack. See also a comparison of Shakapacker with jsbundling-rails. For an in-depth discussion of choosing between shakapacker and jsbundling-rails, see the discussion Webpacker alternatives - which path should we go to? #8783 and the resulting PR Switch away from Webpacker to Shakapacker #10389.

Installation

For an existing Rails app:

bundle add shakapacker --strict
bundle exec rake shakapacker:install

For a new Rails 6+ app:

rails new myapp --skip-javascript
cd myapp
bundle add shakapacker --strict
bundle exec rake shakapacker:install

See the installation guide for requirements, package-manager selection, non-interactive installer modes, and verification steps.

Upgrading

Shakapacker ships as both a Ruby gem and an npm package; keep them on matching versions. Use the common upgrade guides for package-manager changes, Babel-to-SWC migration, webpack-to-Rspack migration, and release-to-release upgrade paths.

Older major-version docs:

Example Apps

ShakaCode Support

ShakaCode focuses on helping Ruby on Rails teams use React and Webpack better. We can upgrade your project and improve your development and customer experiences, allowing you to focus on building new features or fixing bugs instead.

For an overview of working with us, see our Client Engagement Model article and how we bill for time.

We also specialize in helping development teams lower infrastructure and CI costs. Check out our project Control Plane Flow, which can allow you to get the ease of Heroku with the power of Kubernetes and big cost savings.

If you think ShakaCode can help your project, click here to book a call with Justin Gordon, the creator of React on Rails and Shakapacker.

Here's a testimonial of how ShakaCode can help from Florian Gâßler of Blinkist, January 2, 2023:

Hey Justin πŸ‘‹

I just wanted to let you know that we today shipped the webpacker to shakapacker upgrades and it all seems to be running smoothly! Thanks again for all your support and your teams work! 😍

On top of your work, it was now also very easy for me to upgrade Tailwind and include our external node_module based web component library which we were using for our other (more modern) apps already. That work is going to be shipped later this week though as we are polishing the last bits of it. πŸ˜‰

Have a great 2023 and maybe we get to work together again later in the year! πŸ™Œ

Read the full review here.

Here's a testimonial from Jon Rajavuori of Academia.edu about migrating frontend builds from Webpack to rspack with ShakaCode's help, shared in March 2026:

We've been running rspack most of the week now for frontend builds! It's a performance-focused drop-in replacement for Webpack that apparently works as advertised. The impact has been between a 2-4x build speed increase depending on the environment and conditions.

The typical case of first startup with a warm cache has gone from roughly 1m with Webpack down to about 20s β€” close to the amount of time other dev components take to startup.

As for production incremental builds, they now take around 10s when only a few lines in one bundle have changed!

Additional stats from follow-up conversation with Jon:

  • Cold-cache startup: 4m30s β†’ 3m30s (~22% faster; 2-4x gains apply to warm-cache and incremental builds)
  • Production incremental builds: ~10 seconds
  • HMR rebuild time: unchanged at ~8s (bottleneck is orchestration, not compilation)

Community and Support

  • Ask questions in the React + Rails Slack community.
  • Report bugs or request features in GitHub Issues.
  • Get direct help from ShakaCode, the team that maintains Shakapacker and helps Rails teams migrate to Rspack, speed up build pipelines, and stabilize production deploys.

Contributing

See CONTRIBUTING.md for development setup, test commands, and pull request guidelines.

License

Shakapacker is released under the MIT License.

Supporters

The following companies support our Open Source projects, and ShakaCode uses their products!



JetBrains ScoutAPM Control Plane
BrowserStack Honeybadger CodeRabbit