Skip to content

Commit c336d81

Browse files
justin808claude
andcommitted
Add loose: false to SWC config for Stimulus compatibility
Override Shakapacker's default loose: true setting with loose: false to ensure spec-compliant class transforms that work with Stimulus. Without this, Stimulus controllers fail silently even with keepClassNames: true. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ce8f58d commit c336d81

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
@@ -5,6 +5,9 @@ const customConfig = {
55
jsc: {
66
// Preserve class names for Stimulus controller discovery
77
keepClassNames: true,
8+
// Use spec-compliant transforms (override Shakapacker's loose: true default)
9+
// This is required for Stimulus controllers to work correctly
10+
loose: false,
811
transform: {
912
react: {
1013
// Use automatic runtime (React 17+) - no need to import React

0 commit comments

Comments
 (0)