/
vite.config.ts
42 lines (40 loc) 路 968 Bytes
/
vite.config.ts
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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { resolve, dirname } from 'path'
import { fileURLToPath } from 'url'
import { viteStaticCopy } from 'vite-plugin-static-copy'
const __dirname = dirname(fileURLToPath(import.meta.url))
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
viteStaticCopy({
targets: [
{
src: 'manifest.json',
dest: '.',
},
{
src: 'src/assets/img/icon-32.png',
dest: '.',
},
{
src: 'src/assets/img/icon-128.png',
dest: '.',
},
],
}),
],
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: resolve(__dirname, 'src/Content/main.tsx'),
name: 'MyLib',
// the proper extensions will be added
fileName: 'contentScript',
},
},
define: {
'process.env': {},
},
})