SkillAgentSearch skills...

Shakapacker

Use Webpack to manage app-like JavaScript modules in Rails

Install / Use

/learn @shakacode/Shakapacker
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Shakapacker (v9)


🚀 Shakapacker 9 supports Rspack! 10x faster than webpack!

📖 Full documentation at shakapacker.com


Official, actively maintained successor to rails/webpacker. ShakaCode stands behind the long-term maintenance and development of this project for the Rails community.

  • ⚠️ See the 6-stable branch for Shakapacker v6.x code and documentation. :warning:
  • See V9 Upgrade for upgrading from the v8 release.
  • See V8 Upgrade for upgrading from the v7 release.
  • See V7 Upgrade for upgrading from the v6 release.
  • See V6 Upgrade for upgrading from v5 or prior v6 releases.

Ruby based checks Jest specs Rubocop JS lint

node.js Gem npm version

Shakapacker makes it easy to use the JavaScript pre-processor and bundler Webpack v5+ to manage frontend JavaScript in Rails. It can coexist with the asset pipeline, leaving Webpack responsible solely for frontend JavaScript, or can be used exclusively, making it also responsible for images, fonts, and CSS.

Check out 6.1.1+ for SWC and esbuild-loader support! They are faster than Babel!

See 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.

For discussions, see our Slack Channel.


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)

<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> <!-- END doctoc generated TOC please keep comment here to allow auto update -->

Prerequisites

  • Ruby 2.7+
  • Rails 5.2+
  • Node.js 20+

Features

  • Rails view helpers that fully support Webpack output, including HMR and code splitting.
  • Convenient but not required webpack configuration. The only requirement is that your webpack configuration creates a manifest.
  • HMR with the shakapacker-dev-server, such as for hot-reloading React!
  • Automatic code splitting using multiple entry points to optimize JavaScript downloads.
  • Support for NPM, Yarn (classic and berry), PNPM, and Bun
  • Webpack v5+
  • ES6 with babel, SWC, or Esbuild
  • Asset compression, source-maps, and minification
  • CDN support
  • Extensible and configurable. For example, all major dependencies are specified as peers, so you can upgrade easily.

Optional support

Requires extra packages to be installed.

  • React
  • TypeScript
  • Stylesheets - Sass, Less, Stylus and Css, PostCSS
  • CoffeeScript

Installation

Rails v6+

With Rails v6+, skip JavaScript for a new app and follow below Manual Installation Steps to manually add the shakapacker gem to your Gemfile.

rails new myapp --skip-javascript

Note, Rails 6 installs the older v5 version of webpacker unless you specify --skip-javascript.

Add shakapacker gem to your Gemfile:

bundle add shakapacker --strict

Then run the fol

Related Skills

View on GitHub
GitHub Stars468
CategoryDevelopment
Updated13h ago
Forks105

Languages

Ruby

Security Score

95/100

Audited on Apr 3, 2026

No findings