-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
51 lines (50 loc) · 1.34 KB
/
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
43
44
45
46
47
48
49
50
51
/* eslint-disable import/no-extraneous-dependencies */
import { defineConfig } from 'vite';
import { resolve } from 'path';
import vue from '@vitejs/plugin-vue';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {
alias: [
{
find: '@',
replacement: '/src',
},
],
},
build: {
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
splash: resolve(__dirname, 'splashscreen.html'),
},
output: {
assetFileNames: (assetInfo) => {
let ext = assetInfo.name.split('.').at(1);
if (/^(?:png|jpe?g|svg|gif|tiff|bmp|ico)$/i.test(ext)) {
ext = 'images';
} else if (/^(?:woff|woff2)$/i.test(ext)) {
ext = 'fonts';
} else if (/^(?:wav|pcm|mp3|mp4|m4a|aac|flac)$/i.test(ext)) {
ext = 'sounds';
}
return `assets/${ext}/[name].[hash][extname]`;
},
chunkFileNames: 'assets/js/[name].[hash].js',
entryFileNames: 'assets/js/[name].[hash].js',
},
},
target: ['edge89', 'safari15'],
},
css: {
preprocessorOptions: {
scss: {
additionalData: `
@import "/src/assets/styles/variables.scss";
@import "/node_modules/bulma/sass/utilities/mixins.sass";
`,
},
},
},
});