-
Notifications
You must be signed in to change notification settings - Fork 12
/
vite.config.js
54 lines (53 loc) · 1.32 KB
/
vite.config.js
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 { ViteImageOptimizer } from 'vite-plugin-image-optimizer';
import { ViteFaviconsPlugin } from 'vite-plugin-favicon2';
import ViteRestart from 'vite-plugin-restart';
import copy from 'rollup-plugin-copy';
export default ({ command }) => ({
base: command === 'serve' ? '' : '/dist/',
publicDir: 'src/public',
build: {
outDir: 'web/dist/',
emptyOutDir: true,
sourcemap: true,
manifest: 'manifest.json',
minify: 'esbuild',
rollupOptions: {
input: {
index: './src/index.js',
},
output: {
dir: 'web/dist/',
}
},
},
server: {
fs: {
strict: false
},
host: '0.0.0.0',
origin: 'http://localhost:3000',
port: 3000,
strictPort: true
},
plugins: [
ViteRestart({
reload: [
'templates/**/*'
]
}),
ViteFaviconsPlugin({
logo: "src/public/images/favicon.png",
inject: false,
outputPath: '../favicons'
}),
copy({
targets: [
{
src: 'src/public/**/*',
dest: 'web/dist'
}
]
}),
ViteImageOptimizer({})
]
});