-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvite.config.ts
More file actions
37 lines (35 loc) · 764 Bytes
/
Copy pathvite.config.ts
File metadata and controls
37 lines (35 loc) · 764 Bytes
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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import { crx } from '@crxjs/vite-plugin'
import manifest from './manifest.json'
import { fileURLToPath } from 'url'
import path from 'path'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
export default defineConfig({
plugins: [
react(),
tailwindcss(),
crx({ manifest }),
],
server: {
port: 5173,
strictPort: true,
hmr: {
port: 5173,
},
cors: true, // 允许跨域
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
build: {
rollupOptions: {
input: {
welcome: path.resolve(__dirname, 'welcome.html'),
},
},
},
})