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
Add css_modules_export_mode setting as preferred solution
Shakapacker 9.3.1+ supports css_modules_export_mode in shakapacker.yml,
which is simpler than manual webpack configuration.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
css_modules_export_mode: default # Use v8-style default exports
64
+
```
65
+
66
+
This single setting restores the previous behavior without any webpack config changes.
67
+
68
+
See the [Shakapacker CSS Modules Export Mode documentation](https://github.com/shakacode/shakapacker/blob/main/docs/css-modules-export-mode.md) for more details.
69
+
70
+
### Alternative: Manual Webpack Configuration
71
+
72
+
If you're on an older Shakapacker version (< 9.3.1) or need more control, configure the CSS loader directly:
59
73
60
74
```javascript
61
75
// config/webpack/commonWebpackConfig.js
@@ -238,6 +252,8 @@ Add to `package.json`:
238
252
239
253
## Complete Configuration Example
240
254
255
+
> **Note:** If using Shakapacker 9.3.1+, you can skip the CSS modules webpack config by setting `css_modules_export_mode: default` in `shakapacker.yml` (see Step 2).
256
+
241
257
Here's a complete example of a dual Webpack/Rspack compatible configuration:
**Solution:** Apply the CSS modules fix in Step 2.
383
+
**Solution:** Set `css_modules_export_mode:default` in `shakapacker.yml` (Shakapacker 9.3.1+), or apply the manual webpack configuration fix in Step 2.
368
384
369
385
## Performance Benefits
370
386
@@ -376,6 +392,7 @@ After migrating to Rspack, you should see significant build time improvements:
0 commit comments