-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
49 lines (47 loc) · 1.17 KB
/
Copy pathvite.config.ts
File metadata and controls
49 lines (47 loc) · 1.17 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
import { crx, defineManifest } from '@crxjs/vite-plugin'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import UnoCSS from 'unocss/vite'
import { defineConfig } from 'vite'
const manifest = defineManifest({
manifest_version: 3,
name: 'API Request Analyzer',
version: '1.0.0',
description: '接口请求耗时分析工具 - 记录和分析所有HTTP请求的详细耗时',
permissions: ['debugger', 'storage', 'tabs'],
host_permissions: ['<all_urls>'],
background: {
service_worker: 'src/background/index.ts',
type: 'module',
},
action: {
default_popup: 'src/popup/index.html',
default_icon: {
16: 'icon16.png',
32: 'icon32.png',
48: 'icon48.png',
128: 'icon128.png',
},
},
options_page: 'src/options/index.html',
})
export default defineConfig({
plugins: [
UnoCSS(),
svelte(),
{
name: 'no-crossorigin',
transformIndexHtml: {
order: 'post',
handler(html: string) {
return html.replace(/\s+crossorigin(=["\'][^"\']*["\'])?/g, '')
},
},
},
crx({ manifest }),
],
build: {
outDir: 'dist',
modulePreload: false,
cssCodeSplit: false,
},
})