Build a Chrome Extension with Vite.
npm install vite-plugin-crx-mv3
bash
npm
npm install vite-plugin-crx-mv3 -D
or yarn
yarn add vite-plugin-crx-mv3 -D
or pnpm
pnpm add vite-plugin-crx-mv3 -D
`
$3
#### port
- Type: number
- Default: 8181
Create a websocket connection. Notify Chrome extension clients to reload when changes are made to the content_scripts and service_worker files.
#### manifest
- Type: string
- Required : true
Path to the chrome extension's manifest.json
#### reloadPage
- Type: blooen
- Default : true
Control automatic page loading in dev environment
$3
`js
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import crx from 'vite-plugin-crx-mv3'
export default defineConfig({
plugins: [
vue(),
crx({
manifest: './src/manifest.json'
}),
],
})
`
$3
`bash
development
npm run dev
production
npm run build
``