Skip to content

Commit 1b3e731

Browse files
justin808claude
andcommitted
Fix Stimulus compatibility by targeting ES6 class support
Stimulus 3 requires pure ES6 classes and cannot work when transpiled to ES5. By adding env.targets with 'supports es6-class', we ensure SWC doesn't downcompile classes to ES5, which was breaking the Stimulus controller functionality. This follows the same approach needed for TypeScript + Stimulus where targeting ES6 explicitly is required for compatibility. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 1f996e6 commit 1b3e731

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,5 +5,8 @@ module.exports = {
55
runtime: "automatic"
66
}
77
}
8+
},
9+
env: {
10+
targets: "defaults and supports es6-class"
811
}
912
};

0 commit comments

Comments
 (0)