Skip to content

Commit 13e5239

Browse files
authored
Merge pull request #1949 from Skaywalker/patch-1
Update vite.stub
2 parents d046172 + 240c2fc commit 13e5239

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

src/Commands/stubs/vite.stub

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { defineConfig } from 'vite';
22
import laravel from 'laravel-vite-plugin';
3+
import { readdirSync, statSync } from 'fs';
4+
import { join,relative,dirname } from 'path';
5+
import { fileURLToPath } from 'url';
36

47
export default defineConfig({
58
build: {
@@ -19,8 +22,36 @@ export default defineConfig({
1922
}),
2023
],
2124
});
25+
// Scen all resources for assets file. Return array
26+
//function getFilePaths(dir) {
27+
// const filePaths = [];
28+
//
29+
// function walkDirectory(currentPath) {
30+
// const files = readdirSync(currentPath);
31+
// for (const file of files) {
32+
// const filePath = join(currentPath, file);
33+
// const stats = statSync(filePath);
34+
// if (stats.isFile() && !file.startsWith('.')) {
35+
// const relativePath = 'Modules/$STUDLY_NAME$/'+relative(__dirname, filePath);
36+
// filePaths.push(relativePath);
37+
// } else if (stats.isDirectory()) {
38+
// walkDirectory(filePath);
39+
// }
40+
// }
41+
// }
42+
//
43+
// walkDirectory(dir);
44+
// return filePaths;
45+
//}
46+
47+
//const __filename = fileURLToPath(import.meta.url);
48+
//const __dirname = dirname(__filename);
49+
50+
//const assetsDir = join(__dirname, 'resources/assets');
51+
//export const paths = getFilePaths(assetsDir);
52+
2253

2354
//export const paths = [
2455
// 'Modules/$STUDLY_NAME$/resources/assets/sass/app.scss',
2556
// 'Modules/$STUDLY_NAME$/resources/assets/js/app.js',
26-
//];
57+
//];

0 commit comments

Comments
 (0)