-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
29 lines (28 loc) · 1.01 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
import { defineConfig } from 'vite'
export default defineConfig({
build: {
//assetsDir: 'assets',
rollupOptions: {
input: {
main: 'src/index.js',
style: 'src/styles.scss'
},
output: {
entryFileNames: 'js/main.js',
chunkFileNames: 'js/chunks.js',
assetFileNames: ({ name: names }) => {
if (names.endsWith('.css')) {
return 'css/[name].css';
} else if (names.startsWith('images/')) {
return 'assets/images/[name].[ext]'; // Obrázky z `src/images/` do `assets/images/`
} else if (/\.(jpe?g|png|gif|svg|webp|ttf|woff|woff2|eot|otf|mp4|webm)$/.test(names)) {
return 'assets/images/[name].[ext]';
}
return 'assets/[name].[ext]';
}
}
},
outDir: 'static',
emptyOutDir: false
},
})