forked from molvqingtai/WebChat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwxt.config.ts
53 lines (52 loc) · 1.11 KB
/
wxt.config.ts
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
import path from 'node:path'
import { defineConfig } from 'wxt'
import react from '@vitejs/plugin-react'
import { name, displayName, homepage } from './package.json'
import svgr from 'vite-plugin-svgr'
export default defineConfig({
srcDir: path.resolve('src'),
imports: false,
entrypointsDir: 'app',
runner: {
startUrls: ['https://www.example.com/']
},
manifest: ({ browser }) => {
const common = {
name: displayName,
permissions: ['storage', 'notifications', 'tabs'],
homepage_url: homepage,
icons: {
'16': 'logo.png',
'32': 'logo.png',
'48': 'logo.png',
'128': 'logo.png'
},
action: {}
}
return {
chrome: {
...common
},
firefox: {
...common,
browser_specific_settings: {
gecko: {
id: '[email protected]'
}
}
}
}[browser]
},
vite: (env) => ({
define: {
__DEV__: env.mode === 'development',
__NAME__: JSON.stringify(name)
},
plugins: [
react(),
svgr({
include: '**/*.svg'
})
]
})
})