This template provides a minimal setup to get chrome extension using React working in Vite with HMR.
- Clone the repo
yarn
to install dependenciesyarn build
It will create dist folder. I have used vite config to copy the manifest.json file and its dependant script file to dist folder after building. manifest.json is important for the chrome extension. Read more [https://developer.chrome.com/docs/extensions/get-started/tutorial/hello-world]
Then open chrome extensions (type this in the chrome address bar chrome://extensions/
)
- Enable developer mode.
- Click Load unpacked and choose dist folder.
- Once the extension is loaded. pin to the toolbar.
- Click on it. it will open a new panel