vitejs / vitejs/vite-plugin-react
Add "include" and "exclude" option to `@vitejs/plugin-react-swc`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 269
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 19
Description
Related plugins
Description
I want to use SolidJS inside of a React app. With @vitejs/plugin-react I can simply exclude all files that end with *.solid.tsx.
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import solid from "vite-plugin-solid";
export default defineConfig({
plugins: [
react({ exclude: "./src/**/*.solid.tsx" }),
solid({ include: "./src/**/*.solid.tsx" }),
],
});
Is this somehow also possible with @vitejs/plugin-react-swc? Here is an example playground using @vitejs/plugin-react.
Suggested solution
Add "include" and "exclude" option to @vitejs/plugin-react-swc
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the plugin-react-swc package linked in the issue and compare its configuration with plugin-react's include and exclude behavior. Verify the requested SolidJS/React setup, then confirm that matching .solid.tsx files can be excluded from React processing while other files continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100