Skip to content

Commit

Permalink
feat: switch from babel to swc
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas-C committed Dec 11, 2024
1 parent 3e27b85 commit 353f646
Show file tree
Hide file tree
Showing 4 changed files with 150 additions and 309 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ What's in the box?

- React
- Express
- Vite + Babel (ES6)
- Vite + SWC

### Dependencies

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"npm": ">=8.0.0"
},
"devDependencies": {
"@babel/core": "^7.26.0",
"@ndla/preset-panda": "^0.0.48",
"@ndla/scripts": "^2.1.3",
"@ndla/types-backend": "^1.0.1",
Expand All @@ -54,7 +53,7 @@
"@types/prismjs": "^1.26.0",
"@types/react": "^18.3.2",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.4",
"@vitejs/plugin-react-swc": "^3.7.2",
"concurrently": "^9.1.0",
"cross-env": "^7.0.3",
"esbuild": "^0.24.0",
Expand Down
4 changes: 2 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { defineConfig, splitVendorChunkPlugin } from "vite";
import react from "@vitejs/plugin-react";
import react from "@vitejs/plugin-react-swc";

export default defineConfig(() => {
return {
Expand All @@ -17,7 +17,7 @@ export default defineConfig(() => {
globals: true,
setupFiles: "./src/__tests__/vitest.setup.ts",
},
plugins: [react(), splitVendorChunkPlugin()],
plugins: [react({ devTarget: "es2022" }), splitVendorChunkPlugin()],
resolve: {
dedupe: ["react-router", "react-router-dom", "react-helmet-async", "i18next", "react-i18next"],
},
Expand Down
Loading

0 comments on commit 353f646

Please sign in to comment.