-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
35 lines (29 loc) · 896 Bytes
/
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
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import { readdirSync, statSync } from 'fs';
const path = require("path")
const getAllFiles = function(dirPath, arrayOfFiles) {
let files = readdirSync(dirPath)
arrayOfFiles = arrayOfFiles || []
files.forEach(function(file) {
if (statSync(dirPath + "/" + file).isDirectory()) {
arrayOfFiles = getAllFiles(dirPath + "/" + file, arrayOfFiles)
} else {
arrayOfFiles.push(path.join(__dirname, dirPath, "/", file))
}
})
return arrayOfFiles
}
const css_files = getAllFiles("./resources/css/")
const ts_files = getAllFiles("./resources/ts/")
export default defineConfig({
plugins: [
laravel({
input: [
...css_files,
...ts_files,
],
refresh: true,
}),
],
});