Skip to content

Commit 78f0bca

Browse files
committed
feat(reactcompiler): Add React Compiler variants to create-vite
This PR builds upon vitejs/vite-plugin-react#799 and adds 2 new variants to create-vite: compiler, and compiler-ts. This allows new Vite apps to start with React Compiler out of the box.
1 parent 8099582 commit 78f0bca

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/create-vite/src/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ const FRAMEWORKS: Framework[] = [
127127
display: 'TypeScript + SWC',
128128
color: blue,
129129
},
130+
{
131+
name: 'React Compiler (TS)',
132+
display: 'TypeScript + React Compiler',
133+
color: blue,
134+
customCommand:
135+
'npm exec degit vitejs/vite-plugin-react/packages/plugin-react/examples/compiler-ts TARGET_DIR',
136+
},
130137
{
131138
name: 'react',
132139
display: 'JavaScript',
@@ -137,6 +144,13 @@ const FRAMEWORKS: Framework[] = [
137144
display: 'JavaScript + SWC',
138145
color: yellow,
139146
},
147+
{
148+
name: 'React Compiler (JS)',
149+
display: 'JavaScript + React Compiler',
150+
color: yellow,
151+
customCommand:
152+
'npm exec degit vitejs/vite-plugin-react/packages/plugin-react/examples/compiler TARGET_DIR',
153+
},
140154
{
141155
name: 'custom-react-router',
142156
display: 'React Router v7 ↗',

0 commit comments

Comments
 (0)