-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
55 lines (54 loc) · 1.35 KB
/
Copy pathvite.config.ts
File metadata and controls
55 lines (54 loc) · 1.35 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
import { defineConfig } from 'vite';
import { crx } from '@crxjs/vite-plugin';
import react from '@vitejs/plugin-react';
import manifest from './manifest.json' assert { type: 'json' };
import { resolve } from 'path';
export default defineConfig({
plugins: [
react(),
crx({
manifest: {
...manifest,
background: {
service_worker: 'src/background.ts',
type: 'module'
}
}
})
],
build: {
outDir: 'dist',
emptyOutDir: true,
sourcemap: process.env.NODE_ENV === 'development',
rollupOptions: {
input: {
popup: resolve(__dirname, 'src/popup/popup.html')
},
output: {
chunkFileNames: 'assets/[name]-[hash].js',
entryFileNames: 'assets/[name]-[hash].js',
assetFileNames: 'assets/[name]-[hash].[ext]'
}
}
},
resolve: {
alias: {
'@': resolve(__dirname, 'src')
}
},
optimizeDeps: {
include: ['react', 'react-dom']
},
server: {
port: 5173,
strictPort: true,
hmr: {
port: 5173
}
},
esbuild: {
loader: 'tsx',
include: /src\/.*\.[tj]sx?$/,
exclude: [],
}
});