-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathvite.config.ts
More file actions
54 lines (53 loc) · 1.32 KB
/
vite.config.ts
File metadata and controls
54 lines (53 loc) · 1.32 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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { resolve } from 'path';
import { viteStaticCopy } from 'vite-plugin-static-copy';
export default defineConfig({
base: './',
plugins: [
react(),
viteStaticCopy({
targets: [
{
src: 'manifest.json',
dest: '.'
},
{
src: 'public/*',
dest: '.'
},
{
src: 'src/offscreen/offscreen.html',
dest: 'src/offscreen'
},
{
src: 'src/share/share.html',
dest: '.'
}
]
})
],
resolve: {
alias: {
'@': resolve(__dirname, './src')
}
},
build: {
outDir: 'dist',
rollupOptions: {
input: {
popup: resolve(__dirname, 'src/popup/popup.html'),
options: resolve(__dirname, 'src/options/options.html'),
background: resolve(__dirname, 'src/background/service-worker.ts'),
offscreen: resolve(__dirname, 'src/offscreen/offscreen.ts'),
share: resolve(__dirname, 'src/share/share.tsx'),
'content/selection-overlay': resolve(__dirname, 'src/content/selection-overlay.ts')
},
output: {
entryFileNames: '[name].js',
chunkFileNames: 'chunks/[name].js',
assetFileNames: '[name].[ext]'
}
}
}
});