-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.js
More file actions
63 lines (62 loc) · 1.48 KB
/
vite.config.js
File metadata and controls
63 lines (62 loc) · 1.48 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
56
57
58
59
60
61
62
63
import { defineConfig } from 'vite'
import { resolve } from 'path'
export default defineConfig({
base: '/static/',
build: {
outDir: resolve('./core/static/'),
assetsDir: '',
manifest: true,
minify: 'esbuild',
cssMinify: true,
rollupOptions: {
input: {
main: resolve('./core/assets/js/main.js'),
},
output: {
chunkFileNames: 'js/[name]-[hash].js',
entryFileNames: 'js/[name]-[hash].js',
assetFileNames: ({name}) => {
if (/\.(gif|jpe?g|png|svg)$/.test(name ?? '')){
return 'img/[name]-[hash][extname]';
}
if (/\.css$/.test(name ?? '')) {
return 'css/[name]-[hash][extname]';
}
if (/\.(woff2?|eot|ttf|otf)$/.test(name ?? '')) {
return 'fonts/[name][extname]';
}
return '[name]-[hash][extname]';
},
},
},
cssCodeSplit: true,
sourcemap: false,
target: 'es2015',
chunkSizeWarningLimit: 500,
reportCompressedSize: true
},
server: {
host: '0.0.0.0',
port: 3000,
open: false,
origin: 'http://localhost:3000',
hmr: {
host: 'localhost'
},
watch: {
usePolling: true,
disableGlobbing: false,
},
fs: {
strict: false,
allow: ['..']
}
},
resolve: {
alias: {
'@': resolve(__dirname, './'),
'~bootstrap-icons': resolve(__dirname, 'node_modules/bootstrap-icons')
}
},
publicDir: resolve(__dirname, 'public')
})