Refactor CreditBalanceViewSet for improved readability and error handling. Update SiteDefinitionView to allow public access without authentication. Enhance Vite configuration for shared component paths and debugging logs. Remove inaccessible shared CSS imports in main.tsx.
This commit is contained in:
@@ -10,14 +10,22 @@ const sharedPathCandidates = [
|
||||
path.resolve(__dirname, '../frontend/src/components/shared'),
|
||||
path.resolve(__dirname, '../../frontend/src/components/shared'),
|
||||
'/frontend/src/components/shared',
|
||||
path.resolve(__dirname, '../../frontend/src/components/shared'), // Try parent of parent
|
||||
];
|
||||
const sharedComponentsPath = sharedPathCandidates.find((candidate) => fs.existsSync(candidate)) ?? sharedPathCandidates[0];
|
||||
|
||||
// Log for debugging
|
||||
console.log('Shared components path:', sharedComponentsPath);
|
||||
console.log('Path exists:', fs.existsSync(sharedComponentsPath));
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@shared': sharedComponentsPath,
|
||||
// Explicit aliases for CSS files to ensure Vite resolves them
|
||||
'@shared/blocks/blocks.css': path.join(sharedComponentsPath, 'blocks/blocks.css'),
|
||||
'@shared/layouts/layouts.css': path.join(sharedComponentsPath, 'layouts/layouts.css'),
|
||||
},
|
||||
},
|
||||
server: {
|
||||
|
||||
Reference in New Issue
Block a user