-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwxt.config.ts
More file actions
68 lines (67 loc) · 1.79 KB
/
wxt.config.ts
File metadata and controls
68 lines (67 loc) · 1.79 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
import type { OutputOptions } from 'rollup'
import { defineConfig } from 'wxt'
import ViteConfig from './vite.config'
function getBuildOptions() {
delete (ViteConfig.build!.rollupOptions!.output as OutputOptions)!.manualChunks
return ViteConfig.build
}
export default defineConfig({
srcDir: `src`,
modulesDir: `src/modules`,
manifest: ({ mode, browser }) => ({
name: `公众号内容编辑器`,
icons: {
256: mode === `development` ? `/mpmd/icon-256-gray.png` : `/mpmd/icon-256.png`,
},
permissions: [`storage`, `activeTab`, `sidePanel`, `contextMenus`],
host_permissions: [
`https://*.github.com/*`,
`https://*.githubusercontent.com/*`,
`https://*.gitee.com/*`,
`https://*.weixin.qq.com/*`,
// 微信公众号图片
`https://*.qpic.cn/*`,
],
web_accessible_resources: [
{
resources: [`*.png`, `*.svg`, `injected.js`],
matches: [`<all_urls>`],
},
],
side_panel: browser === `chrome`
? {
default_path: `sidepanel.html`,
}
: undefined,
sidebar_action: browser === `firefox`
? {
default_panel: `sidepanel.html`,
default_icon: {
256: `mpmd/icon-256.png`,
},
default_title: `MD 公众号编辑器`,
}
: undefined,
commands: {
_execute_sidebar_action: {
description: `Open MD Editor Side Panel`,
suggested_key: {
default: `Ctrl+Shift+Y`,
},
},
},
}),
analysis: {
open: true,
},
vite: () => ({
...ViteConfig,
plugins: ViteConfig.plugins!.filter(plugin =>
typeof plugin === `object`
&& plugin !== null
&& !(`name` in plugin && plugin.name === `vite-plugin-Radar`),
),
build: getBuildOptions(),
base: `/`,
}),
})