Skip to content

Commit

Permalink
Add react router compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
brookslybrand committed Dec 17, 2024
1 parent cc68cd2 commit 29cfc8c
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 6 deletions.
118 changes: 114 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@react-router/express": "^7.0.2",
"@react-router/node": "^7.0.1",
"@types/express": "^5.0.0",
"babel-plugin-react-compiler": "^19.0.0-beta-201e55d-20241215",
"cheerio": "^1.0.0-rc.12",
"classnames": "^2.3.2",
"compression": "^1.7.5",
Expand Down Expand Up @@ -60,9 +61,12 @@
"tiny-invariant": "^1.3.1",
"typedoc": "^0.27.4",
"unified": "^11.0.4",
"unist-util-visit": "^5.0.0"
"unist-util-visit": "^5.0.0",
"vite-plugin-babel": "^1.3.0"
},
"devDependencies": {
"@babel/preset-react": "^7.26.3",
"@babel/preset-typescript": "^7.26.0",
"@react-router/dev": "7.0.1",
"@testing-library/jest-dom": "^5.16.5",
"@types/eslint": "^8.56.6",
Expand Down
16 changes: 15 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { reactRouter } from "@react-router/dev/vite";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
import babel from "vite-plugin-babel";

export default defineConfig(({ isSsrBuild }) => ({
build: {
Expand All @@ -13,5 +14,18 @@ export default defineConfig(({ isSsrBuild }) => ({
ssr: {
noExternal: ["@docsearch/react"],
},
plugins: [reactRouter(), tsconfigPaths()],
plugins: [
babel({
filter: /app\/.*\.[jt]sx?$/,
babelConfig: {
presets: [
"@babel/preset-typescript",
["@babel/preset-react", { runtime: "automatic" }],
],
plugins: ["babel-plugin-react-compiler"],
},
}),
reactRouter(),
tsconfigPaths(),
],
}));

0 comments on commit 29cfc8c

Please sign in to comment.