-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwxt.config.ts
More file actions
102 lines (96 loc) · 2.23 KB
/
wxt.config.ts
File metadata and controls
102 lines (96 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import { defineConfig } from 'wxt';
import { resolve } from 'path';
export default defineConfig({
// 模块配置
modules: ['@wxt-dev/module-vue', '@wxt-dev/auto-icons'],
srcDir: 'src',
autoIcons: {
developmentIndicator: false
},
// 构建配置
build: {
outDir: '.output',
rollupOptions: {
external: ['wxt/browser'],
}
},
// Vite 配置
vite: (config) => {
// 引入 vite.config.ts
// const viteConfig = require('./vite.config.ts').default;
const viteConfig = config;
// 合并配置,保留 wxt/browser 别名,并覆盖 build.outDir 配置
return {
...viteConfig,
base: './',
// build: {
// // 控制输出资产目录的名称
// assetsDir: 'assets',
// },
optimizeDeps: {
exclude: []
},
// build: {
// ...viteConfig.build,
// // 覆盖 outDir 配置,使用 WXT 的默认输出目录
// // outDir: undefined
// outDir: '.output',
// },
resolve: {
...viteConfig.resolve,
alias: {
...viteConfig.resolve?.alias,
'wxt/browser': resolve(__dirname, 'node_modules/wxt/dist/browser.mjs')
}
}
};
},
// Manifest 配置
manifest: {
// 扩展基本信息
name: 'seekflow',
version: '1.0.0',
description: 'SeekFlow 智能探索助手',
// 扩展图标
// icons: {
// 16: '~/assets/icon.png',
// 32: '~/assets/icon.png',
// 48: '~/assets/icon.png',
// 128: '~/assets/icon.png'
// },
autoIcons: {
baseIconPath: '~/assets/logo.svg'
},
// 扩展图标点击行为
action: {
// 移除默认弹窗,使用点击事件打开 index.html
default_popup: ""
},
// 扩展权限
permissions: [
'storage',
'activeTab',
'tabs',
'scripting',
'tabGroups',
'sidePanel'
],
// 主机权限
host_permissions: [
'https://*/*',
'http://127.0.0.1/*',
'http://localhost/*'
],
web_accessible_resources: [
{
resources: [
'index.html',
'assets/*'
],
matches: [
'<all_urls>'
]
}
],
}
});