This is the excellent vitesse-webext
, updated to work with manifest V3 and without the content scripts.
Currently we copy the icon fonts to our own assets dir, since they fail to load otherwise. This needs to be fixed but I'm not sure how.
src
- main source.background
- scripts for background.components
- auto-imported Vue components that are shared in popup and options page.styles
- styles shared in popup and options page.assets
- static assets.
dist
- built files, also serve stub entry for Vite on development.scripts
- development and bundling helper scripts.manifest.ts
- manifest for the extension.
$ pnpm dev
Then load extension in browser with the dist/
folder.
For Firefox developers, you can run the following command instead:
$ pnpm start:firefox
web-ext
will auto reload the extension when dist/
files changed.
While Vite handles HMR automatically in the most of the case, Extensions Reloader is still recommanded for cleaner hard reloading.
To build the extension, run
$ pnpm release:firefox
,or
$ pnpm release:chromium
Then you can upload extension.crx
or extension.xpi
to the appropriate extension store.