users menu listing
This commit is contained in:
+10
-64
@@ -6,88 +6,34 @@ import { existsSync, readdirSync, statSync } from 'node:fs';
|
||||
import { join, relative } from 'node:path';
|
||||
|
||||
const projectRoot = process.cwd();
|
||||
|
||||
function discoverModuleInputs() {
|
||||
const modulesPath = join(projectRoot, 'Modules');
|
||||
|
||||
if (!existsSync(modulesPath)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (!existsSync(modulesPath)) return [];
|
||||
const inputs = [];
|
||||
|
||||
for (const moduleName of readdirSync(modulesPath)) {
|
||||
const modulePath = join(modulesPath, moduleName);
|
||||
|
||||
if (!statSync(modulePath).isDirectory()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Canonical Laravel Modules asset paths only.
|
||||
for (const entry of [
|
||||
'Resources/assets/css/app.css',
|
||||
'Resources/assets/js/app.js',
|
||||
]) {
|
||||
if (!statSync(modulePath).isDirectory()) continue;
|
||||
for (const entry of ['Resources/assets/css/app.css','Resources/assets/js/app.js']) {
|
||||
const candidate = join(modulePath, entry);
|
||||
|
||||
if (existsSync(candidate)) {
|
||||
inputs.push(relative(projectRoot, candidate));
|
||||
}
|
||||
if (existsSync(candidate)) inputs.push(relative(projectRoot, candidate));
|
||||
}
|
||||
}
|
||||
|
||||
return inputs;
|
||||
}
|
||||
|
||||
const moduleInputs = discoverModuleInputs();
|
||||
|
||||
console.log('[Vite] Backend theme inputs:');
|
||||
console.log(' resources/themes/backend/assets/css/app.css');
|
||||
console.log(' resources/themes/backend/assets/js/passkeys.js');
|
||||
|
||||
if (moduleInputs.length > 0) {
|
||||
console.log('[Vite] Module inputs:');
|
||||
|
||||
for (const input of moduleInputs) {
|
||||
console.log(` ${input}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
plugins:[
|
||||
laravel({
|
||||
input: [
|
||||
input:[
|
||||
'resources/themes/backend/assets/css/app.css',
|
||||
'resources/themes/backend/assets/js/passkeys.js',
|
||||
'resources/themes/backend/assets/js/layout.js',
|
||||
...moduleInputs,
|
||||
],
|
||||
|
||||
refresh: [
|
||||
'resources/themes/backend/views/**/*.blade.php',
|
||||
'resources/themes/backend/assets/**/*',
|
||||
'Modules/*/Resources/views/**/*.blade.php',
|
||||
'Modules/*/Resources/assets/**/*',
|
||||
'Modules/**/*.php',
|
||||
],
|
||||
|
||||
fonts: [
|
||||
bunny('Instrument Sans', {
|
||||
weights: [400, 500, 600],
|
||||
optimizedFallbacks: false,
|
||||
}),
|
||||
],
|
||||
refresh:['resources/themes/backend/views/**/*.blade.php','resources/themes/backend/assets/**/*','Modules/*/Resources/views/**/*.blade.php','Modules/*/Resources/assets/**/*','Modules/**/*.php'],
|
||||
fonts:[bunny('Instrument Sans',{weights:[400,500,600],optimizedFallbacks:false})],
|
||||
}),
|
||||
|
||||
tailwindcss(),
|
||||
],
|
||||
|
||||
server: {
|
||||
cors: true,
|
||||
watch: {
|
||||
ignored: [
|
||||
'**/storage/framework/views/**',
|
||||
'**/Modules/*/node_modules/**',
|
||||
],
|
||||
},
|
||||
},
|
||||
server:{cors:true,watch:{ignored:['**/storage/framework/views/**','**/Modules/*/node_modules/**']}},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user