Overview:
This project is a boilerplate for creating chrome extensions using React and Typescript. The focus of this project was to improve build speed and development experience with Vite.
Features:
- React 18
- TypeScript
- Vite
- React Testing Library
- SASS
- Prettier
- ESLint
- Husky
- Commitlint
- Conventional Commits
- Chrome Extension Manifest Version 3
- HRR (Hot Rebuild & Refresh/Reload)
Installation:
To install this boilerplate, follow the steps below:
- Clone this repository.
- Change the name and description in package.json to auto synchronize with the manifest.
- Install pnpm globally:
npm install -g pnpm(make sure your node version is >= 16.6, recommended >= 18) - Run
pnpm install. - Depending on your needs:
- For Chrome:
- Run
pnpm dev or npm run devfor development. - Run
pnpm build or npm run buildfor production. - Open Chrome and go to
chrome://extensions. - Enable Developer mode.
- Click on “Load unpacked extension”.
- Select the
distfolder.
- Run
- For Firefox:
- Run
pnpm dev:firefox or npm run dev:firefoxfor development. - Run
pnpm build:firefox or npm run build:firefoxfor production. - Open Firefox and go to
about:debugging#/runtime/this-firefox. - Click on “Load Temporary Add-on…”.
- Select the
manifest.jsonfile from thedistfolder. - Note that in Firefox, the plugin will be in temporary mode and will disappear after closing the browser. You will need to add it again on the next launch.
- Run
- For Chrome:
Summary:
This project is a boilerplate for creating chrome extensions using React and Typescript. It focuses on improving build speed and development experience with Vite. It includes several features such as React 18, TypeScript, Vite, and more. The installation process involves cloning the repository, installing dependencies, and configuring the extension for either Chrome or Firefox.