Skip to content

Commit 62ee4f1

Browse files
justin808claude
andcommitted
Switch from Babel to SWC for faster JavaScript transpilation
This commit migrates the project from Babel to SWC (Speedy Web Compiler) following the Shakapacker documentation. Changes: - Update shakapacker.yml to use 'swc' as javascript_transpiler - Install @swc/core and swc-loader dependencies - Add ajv dependency to resolve module resolution issues SWC is a Rust-based compiler that provides significantly faster compilation times compared to Babel (up to 20x faster according to SWC documentation). The existing Babel configuration and dependencies remain in place as they may still be needed by other tooling like ESLint and Jest. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ef11653 commit 62ee4f1

File tree

3 files changed

+1584
-1391
lines changed

3 files changed

+1584
-1391
lines changed

config/shakapacker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ default: &default
88
cache_path: tmp/shakapacker
99
webpack_compile_output: true
1010
nested_entries: true
11-
javascript_transpiler: babel
11+
javascript_transpiler: swc
1212

1313
# Additional paths webpack should lookup modules
1414
# ['app/assets', 'engine/foo/app/assets']

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
"@rails/actioncable": "7.0.5",
4646
"@rescript/core": "^0.5.0",
4747
"@rescript/react": "^0.11.0",
48+
"@swc/core": "^1.13.5",
49+
"ajv": "^8.17.1",
4850
"autoprefixer": "^10.4.14",
4951
"axios": "^0.21.1",
5052
"babel-loader": "^9.1.2",
@@ -96,6 +98,7 @@
9698
"shakapacker": "9.0.0-beta.8",
9799
"stimulus": "^3.0.1",
98100
"style-loader": "^3.3.1",
101+
"swc-loader": "^0.2.6",
99102
"tailwindcss": "^3.3.3",
100103
"terser-webpack-plugin": "5",
101104
"turbolinks": "^5.2.0",

0 commit comments

Comments
 (0)