-
Notifications
You must be signed in to change notification settings - Fork 146
/
vite.config.mjs
36 lines (32 loc) · 1.05 KB
/
vite.config.mjs
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
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
const input = [
'./assets/js/subscriptions.js',
];
const adminAssets = [
'subscriptions.css',
];
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
build: {
rollupOptions: {
input: input, // Specify your main entry point file
output: {
entryFileNames: 'js/[name].min.js',
assetFileNames: (assetInfo) => {
const info = assetInfo.name.split('.');
const extType = info[info.length - 1];
if (/\.(css)$/.test(assetInfo.name)) {
if (adminAssets.includes( assetInfo.name )) {
return `css/admin/[name].min.${extType}`;
}
return `css/[name].min.${extType}`;
}
}
},
},
outDir: './assets', // Output to the same directory as source code
emptyOutDir: false
},
})