-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
46 lines (45 loc) · 1.16 KB
/
vite.config.ts
File metadata and controls
46 lines (45 loc) · 1.16 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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { crx } from '@crxjs/vite-plugin';
import { resolve } from 'path';
import manifest from './manifest.config';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
crx({ manifest }),
],
resolve: {
alias: {
'@': resolve(__dirname, './src'),
'@components': resolve(__dirname, './src/components'),
'@hooks': resolve(__dirname, './src/hooks'),
'@lib': resolve(__dirname, './src/lib'),
'@utils': resolve(__dirname, './src/utils'),
'@store': resolve(__dirname, './src/store'),
'@types': resolve(__dirname, './src/types'),
},
},
build: {
outDir: 'dist',
emptyOutDir: true,
target: 'esnext',
// CRXJS handles rollup configuration automatically
rollupOptions: {
input: {
offscreen: resolve(__dirname, 'src/offscreen/offscreen.html'),
},
output: {
chunkFileNames: 'assets/[name]-[hash].js',
assetFileNames: 'assets/[name]-[hash][extname]',
},
},
},
server: {
port: 5173,
strictPort: true,
hmr: {
port: 5173,
},
},
});