-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
52 lines (50 loc) · 1.12 KB
/
vite.config.js
File metadata and controls
52 lines (50 loc) · 1.12 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
// vite.config.js
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'
export default defineConfig({
base: '/',
plugins: [
vue(),
vueDevTools(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
css: {
preprocessorOptions: {
scss: {
additionalData: ''
}
}
},
server: {
port: 5173,
strictPort: true,
open: true
},
build: {
outDir: 'dist',
assetsInlineLimit: 4096,
emptyOutDir: true,
rollupOptions: {
output: {
assetFileNames: (assetInfo) => {
let extType = assetInfo.name.split('.').at(1)
if (/png|jpe?g|svg|gif|webp|avif/i.test(extType)) {
extType = 'img'
}
return `assets/${extType}/[name]-[hash][extname]`
},
chunkFileNames: 'assets/js/[name]-[hash].js',
entryFileNames: 'assets/js/[name]-[hash].js'
}
}
},
optimizeDeps: {
include: ['vue', 'pinia', '@uploadcare/upload-client']
}
})