- 安装 npm 依赖 (Vue 3, Vite, @crxjs/vite-plugin) - 配置 vite.config.js 支持 Chrome Extension - 创建基础入口文件 (background, content, popup, options) - 配置构建输出到 dist/ 目录 - 添加占位图标文件
20 lines
406 B
JavaScript
20 lines
406 B
JavaScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import { crx } from '@crxjs/vite-plugin'
|
|
import manifest from './manifest.json' with { type: 'json' }
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
crx({ manifest })
|
|
],
|
|
build: {
|
|
rollupOptions: {
|
|
input: {
|
|
popup: 'src/popup/index.html',
|
|
options: 'src/options/index.html'
|
|
}
|
|
}
|
|
}
|
|
})
|