Skip to content

Commit

Permalink
fix(react): enable vitejs-plugin-react-swc for swc compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
@NgDaddy Paweł Twardziak committed Aug 15, 2024
1 parent 8c7e361 commit 6a9c9c6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/react/src/generators/library/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ export async function libraryGeneratorInternal(host: Tree, schema: Schema) {
"'react-dom'",
"'react/jsx-runtime'",
],
imports: [`import react from '@vitejs/plugin-react'`],
imports: [
options.compiler === 'swc'
? `import react from '@vitejs/plugin-react-swc'`
: `import react from '@vitejs/plugin-react'`,
],
plugins: ['react()'],
},
true
Expand Down

0 comments on commit 6a9c9c6

Please sign in to comment.