You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Documented measured build times comparing Webpack and Rspack:
- Development builds: Rspack 2.2x faster (4.74s → 2.15s)
- Production builds: Rspack 1.56x faster (11.26s → 7.21s)
Added new "Webpack and Rspack" section explaining how to switch
between bundlers and the performance benefits of using Rspack.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+36-2Lines changed: 36 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -165,10 +165,44 @@ See package.json and Gemfile for versions
165
165
+ **Testing Mode**: When running tests, it is useful to run `foreman start -f Procfile.spec` in order to have webpack automatically recompile the static bundles. Rspec is configured to automatically check whether or not this process is running. If it is not, it will automatically rebuild the webpack bundle to ensure you are not running tests on stale client code. This is achieved via the `ReactOnRails::TestHelper.configure_rspec_to_compile_assets(config)`
166
166
line in the `rails_helper.rb` file. If you are using this project as an example and are not using RSpec, you may want to implement similar logic in your own project.
167
167
168
-
## Webpack
168
+
## Webpack and Rspack
169
169
170
-
_Converted to use Shakapacker webpack configuration_.
170
+
_Converted to use Shakapacker with support for both Webpack and Rspack bundlers_.
171
171
172
+
This project supports both Webpack and Rspack as JavaScript bundlers via [Shakapacker](https://github.com/shakacode/shakapacker). Switch between them by changing the `assets_bundler` setting in `config/shakapacker.yml`:
173
+
174
+
```yaml
175
+
# Use Rspack (default - faster builds)
176
+
assets_bundler: rspack
177
+
178
+
# Or use Webpack (classic, stable)
179
+
assets_bundler: webpack
180
+
```
181
+
182
+
### Performance Comparison
183
+
184
+
Measured build times for this project:
185
+
186
+
| Build Type | Webpack | Rspack | Improvement |
187
+
|------------|---------|--------|-------------|
188
+
| Development | 4.74s | 2.15s |**2.2x faster**|
189
+
| Production | 11.26s | 7.21s |**1.56x faster**|
190
+
191
+
**Benefits of Rspack:**
192
+
- 54% faster development builds (saves ~2.6s per build)
193
+
- 36% faster production builds (saves ~4s per build)
194
+
- Faster incremental rebuilds during development
195
+
- Reduced CI build times
196
+
- Drop-in replacement - same configuration files work for both bundlers
197
+
198
+
### Configuration Files
199
+
200
+
All bundler configuration is in `config/webpack/`:
201
+
-`webpack.config.js` - Main entry point (auto-detects Webpack or Rspack)
0 commit comments