aklinker1 / vite-plugin-web-extension

Vite plugin for developing Chrome/Web Extensions
https://vite-plugin-web-extension.aklinker1.io/
MIT License
654 stars 57 forks source link

Create React Starter Kit Templates #59

Closed aklinker1 closed 1 year ago

aklinker1 commented 1 year ago

I'd love some help gettin the React templates setup.

I ran into issues with Vite 4 and both the react plugins (@vitejs/plugin-react and @vitejs/plugin-react-swc). See https://github.com/aklinker1/vite-plugin-web-extension/pull/58#issuecomment-1362288302 for more details. I don't have much experience with Vite and React, so maybe I'm just doing something weird? Here's the farthest I got:

https://github.com/aklinker1/vite-plugin-web-extension/tree/07f2eec9aa7b666fad6a3484a9c711812cffbba8/packages/create-vite-plugin-web-extension/templates/react-js

Essentially, I just ran pnpm vite create -t react-js react-js inside packages/create-vite-plugin-web-extension/templates to create a boilerplate vite + react project, then brought over and merged the files/config from the js template.

I'd prefer the template uses SWC, but if we can get it working using the regular plugin, that's fine too.

We need two React templates: react-js and react-ts.