Skip to content

Commit ce8f58d

Browse files
justin808claude
andcommitted
Add React automatic runtime to SWC config to match Babel
Match the Babel configuration's React automatic runtime setting, which enables the new JSX transform (no need to import React). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent f3d910d commit ce8f58d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

config/swc.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ const customConfig = {
77
keepClassNames: true,
88
transform: {
99
react: {
10+
// Use automatic runtime (React 17+) - no need to import React
11+
runtime: 'automatic',
1012
// Enable React Fast Refresh in development
1113
refresh: env.isDevelopment && env.runningWebpackDevServer,
1214
},

0 commit comments

Comments
 (0)