Jonghakseo / chrome-extension-boilerplate-react-vite

Chrome Extension Boilerplate with React + Vite + Typescript
MIT License
1.85k stars 281 forks source link
logo

Chrome Extension Boilerplate with
React + Vite + TypeScript

![](https://img.shields.io/badge/React-61DAFB?style=flat-square&logo=react&logoColor=black) ![](https://img.shields.io/badge/Typescript-3178C6?style=flat-square&logo=typescript&logoColor=white) ![](https://badges.aleen42.com/src/vitejs.svg) ![GitHub action badge](https://github.com/Jonghakseo/chrome-extension-boilerplate-react-vite/actions/workflows/build-zip.yml/badge.svg) hits > This boilerplate > has [Legacy version](https://github.com/Jonghakseo/chrome-extension-boilerplate-react-vite/tree/legacy)

[!TIP] This project is listed in the Awesome Vite

[!IMPORTANT] Share storage state between every page

https://github.com/Jonghakseo/chrome-extension-boilerplate-react-vite/assets/53500778/1992e46c-032a-4743-bbd2-c421757517d7

Table of Contents

Intro

This boilerplate is made for creating chrome extensions using React and Typescript.

The focus was on improving the build speed and development experience with Vite(Rollup) & Turborepo.

Features

Install

Procedures:

  1. Clone this repository.
  2. Change extensionDescription and extensionName in messages.json file.
  3. Install pnpm globally: npm install -g pnpm (check your node version >= 18.12.0)
  4. Run pnpm install

And next, depending on the needs:

For Chrome:

  1. Run:
    • Dev: pnpm dev
      • When you run with Windows, you should run as administrator. (Issue#456)
    • Prod: pnpm build
  2. Open in browser - chrome://extensions
  3. Check - Developer mode
  4. Find and Click - Load unpacked extension
  5. Select - dist folder at root

For Firefox:

  1. Run:
    • Dev: pnpm dev:firefox
    • Prod: pnpm build:firefox
  2. Open in browser - about:debugging#/runtime/this-firefox
  3. Find and Click - Load Temporary Add-on...
  4. Select - manifest.json from dist folder at root

Remember in firefox you add plugin in temporary mode, that's mean it's disappear after close browser, you must do it again, on next launch.

Structure

ChromeExtension

Main app with background script, manifest

Packages

Some shared packages

Pages

Reference

Star History

Star History Chart

Contributors

This Boilerplate is made possible thanks to all of its contributors.

All Contributors


Special Thanks To

JetBrains Logo (Main) logo. Jackson Hong

Made by Jonghakseo