-
Notifications
You must be signed in to change notification settings - Fork 380
Switch from Babel to SWC for faster JavaScript transpilation #677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
62ee4f1
cf7fd99
ffca3cb
f3d910d
ce8f58d
c336d81
a2654d7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| const { env } = require('shakapacker'); | ||
|
|
||
| const customConfig = { | ||
| options: { | ||
| jsc: { | ||
| transform: { | ||
| react: { | ||
| refresh: env.isDevelopment && env.runningWebpackDevServer, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| module.exports = customConfig; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,8 @@ | |
| "@rails/actioncable": "7.0.5", | ||
| "@rescript/core": "^0.5.0", | ||
| "@rescript/react": "^0.11.0", | ||
| "@swc/core": "^1.13.5", | ||
| "ajv": "^8.17.1", | ||
|
Comment on lines
+48
to
+49
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainVerify that the SWC dependency versions are current. The versions of SWC-related packages may be outdated. Please ensure you're using the latest stable versions for optimal performance and security. Since my knowledge may be outdated, please verify the current versions: Also applies to: 101-101 🌐 Web query: 💡 Result: @swc/core — 1.13.1 (latest stable, published Jul 19, 2025). [1] Sources: Update @swc/core to latest stable (1.13.1) 🤖 Prompt for AI Agents |
||
| "autoprefixer": "^10.4.14", | ||
| "axios": "^0.21.1", | ||
| "babel-loader": "^9.1.2", | ||
|
|
@@ -96,6 +98,7 @@ | |
| "shakapacker": "9.0.0-beta.8", | ||
| "stimulus": "^3.0.1", | ||
| "style-loader": "^3.3.1", | ||
| "swc-loader": "^0.2.6", | ||
| "tailwindcss": "^3.3.3", | ||
| "terser-webpack-plugin": "5", | ||
| "turbolinks": "^5.2.0", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the SWC configuration structure and add missing essential settings.
The current configuration has two issues:
Incorrect structure: The
optionswrapper (line 4) is likely incorrect. SWC configurations forswc-loadertypically havejscat the root level, not nested underoptions.Missing essential configuration: The config lacks critical settings:
Apply this diff to fix the structure and add essential configuration:
📝 Committable suggestion
🤖 Prompt for AI Agents