Skip to content

Commit f3d910d

Browse files
justin808claude
andcommitted
Fix SWC config to preserve class names for Stimulus compatibility
Add keepClassNames: true to SWC configuration to ensure Stimulus controllers work correctly. Without this setting, class names are mangled during transpilation, breaking Stimulus functionality. This fixes failing RSpec tests for Turbo/Stimulus form submission. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent ffca3cb commit f3d910d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

config/swc.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ const { env } = require('shakapacker');
33
const customConfig = {
44
options: {
55
jsc: {
6+
// Preserve class names for Stimulus controller discovery
7+
keepClassNames: true,
68
transform: {
79
react: {
10+
// Enable React Fast Refresh in development
811
refresh: env.isDevelopment && env.runningWebpackDevServer,
912
},
1013
},

0 commit comments

Comments
 (0)