-
Notifications
You must be signed in to change notification settings - Fork 176
/
vite.config.js
58 lines (51 loc) · 1.44 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
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
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import html from '@rollup/plugin-html';
import { glob } from 'glob';
/**
* Get Files from a directory
* @param {string} query
* @returns array
*/
function GetFilesArray(query) {
return glob.sync(query);
}
/**
* Js Files
*/
// Page JS Files
const pageJsFiles = GetFilesArray('resources/assets/js/*.js');
// Processing Vendor JS Files
const vendorJsFiles = GetFilesArray('resources/assets/vendor/js/*.js');
// Processing Libs JS Files
const LibsJsFiles = GetFilesArray('resources/assets/vendor/libs/**/*.js');
/**
* Scss Files
*/
// Processing Core, Themes & Pages Scss Files
const CoreScssFiles = GetFilesArray('resources/assets/vendor/scss/**/!(_)*.scss');
// Processing Libs Scss & Css Files
const LibsScssFiles = GetFilesArray('resources/assets/vendor/libs/**/!(_)*.scss');
const LibsCssFiles = GetFilesArray('resources/assets/vendor/libs/**/*.css');
// Processing Fonts Scss Files
const FontsScssFiles = GetFilesArray('resources/assets/vendor/fonts/!(_)*.scss');
export default defineConfig({
plugins: [
laravel({
input: [
'resources/css/app.css',
'resources/assets/css/demo.css',
'resources/js/app.js',
...pageJsFiles,
...vendorJsFiles,
...LibsJsFiles,
...CoreScssFiles,
...LibsScssFiles,
...LibsCssFiles,
...FontsScssFiles
],
refresh: true
}),
html()
]
});