Skip to content

Another vite powered web extension (chrome, firefox, etc.) starter template.

Notifications You must be signed in to change notification settings

ssjblue197/vite-vue3-chrome-extension-v3

 
 

Repository files navigation

vite-vue3-browser-extension-v3

build release

A Vite powered WebExtension (Chrome, FireFox, etc.) starter template based on manifest 3, vue3 and vite.

Features

  • Vue 3 - Composition API, Script setup and more!
  • Vue 3 app in Content Script too (template added)
  • Vue devtools support
  • HMR for extension pages and content scripts
  • Sample onInstall & onUpdate pages
  • Tailwind css And daisyUI
  • Tailwindcss plugins for Typography, forms, prettier and daisy ui
  • Vue Router setup incuding vite-plugin-pages for automatic route registration
  • vscode recommended settings and extensions for chrome plugin development
  • Effortless communications - powered by webext-bridge
  • Components auto importing
  • Icons - Access to icons from any iconset directly
  • TypeScript - type safe
  • Eslint & Prettier configured for vue, javascript, TypeScript
  • CRXJS Vite Plugin Build a Chrome Extension with Vite
  • Github build and release actions

Please create an issue if you feel some feature is missing or could be improved.

Pre-packed

WebExtension Libraries

Vite Plugins

Vue Plugins

  • VueUse - collection of useful composition APIs

UI Frameworks

  • tailwindcss - A utility-first CSS framework
  • daisyUI - The most popular component library for Tailwind CSS

Tailwind css forms and typography plugins are enabled for default styling of form controls.

Coding Style

Use the Template

GitHub Template

Create a repo from this template on GitHub.

Clone to local

If you prefer to do it manually with the cleaner git history

If you don't have pnpm installed, run: npm install -g pnpm

pnpx degit mubaidr/vite-vue3-chrome-extension-v3 my-webext
cd my-webext
pnpm i

Usage

Folders

  • src - main source.
    • content-script - scripts and components to be injected as content_script
      • iframe content script iframe vue3 app which will be injected into page
    • background - scripts for background.
    • popup - popup vuejs application root
      • pages - popup pages
    • options - options vuejs application root
      • pages - options pages
    • install - Extension install success page
    • update - Extension update success page
    • offscreen - Chrome extension offscreen pages, can be used for audio, screen recording
    • pages - application pages, common to all views (About, Contact, Authentication etc)
    • components - auto-imported Vue components that are shared in popup and options page.
    • assets - assets used in Vue components
  • dist - built files, also serve stub entry for Vite on development.

Development

pnpm dev

Then load extension in browser with the dist/ folder.

Build

To build the extension, run

pnpm build

And then pack files under dist, you can upload dist.crx or dist.xpi to appropriate extension store.

Credits

This template is heavenly inspired by: https://github.com/antfu/vitesse-webext

About

Another vite powered web extension (chrome, firefox, etc.) starter template.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 45.1%
  • HTML 27.0%
  • Vue 16.8%
  • JavaScript 6.7%
  • SCSS 4.4%