-
Notifications
You must be signed in to change notification settings - Fork 175
Expand file tree
/
Copy pathwxt.config.ts
More file actions
64 lines (63 loc) · 1.57 KB
/
Copy pathwxt.config.ts
File metadata and controls
64 lines (63 loc) · 1.57 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
import path from 'node:path'
import { defineConfig } from 'wxt'
import react, { reactCompilerPreset } from '@vitejs/plugin-react'
import babel from '@rolldown/plugin-babel'
import { name, displayName, homepage } from './package.json'
import svgr from 'vite-plugin-svgr'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
srcDir: path.resolve('src'),
imports: false,
entrypointsDir: 'app',
webExt: {
startUrls: ['https://www.example.com/'],
openDevtools: true
},
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,
// Offscreen Document hosts the shared WebRTC Runtime on Chrome/Edge;
// Firefox hosts it in the persistent background page instead.
permissions: [...common.permissions, 'offscreen']
},
firefox: {
...common,
browser_specific_settings: {
gecko: {
id: 'molvqingtai@gmail.com'
}
}
}
}[browser]
},
vite: (env) =>
({
define: {
__DEV__: env.mode === 'development',
__NAME__: JSON.stringify(name)
},
plugins: [
react(),
babel({
presets: [reactCompilerPreset()]
}),
tailwindcss(),
svgr({
include: '**/*.svg'
})
]
}) as any
})