- Merged the site builder functionality into the main app, enhancing the SiteBuilderWizard component with new steps and improved UI. - Updated the Docker Compose configuration by removing the separate site builder service and integrating its functionality into the igny8_sites service. - Enhanced Vite configuration to support code-splitting for builder routes, optimizing loading times. - Updated package dependencies to include new libraries for state management and form handling.
45 lines
1.4 KiB
TypeScript
45 lines
1.4 KiB
TypeScript
import fs from 'node:fs';
|
|
import path from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
const sharedPathCandidates = [
|
|
path.resolve(__dirname, '../frontend/src/components/shared'),
|
|
path.resolve(__dirname, '../../frontend/src/components/shared'),
|
|
'/frontend/src/components/shared',
|
|
];
|
|
const sharedComponentsPath = sharedPathCandidates.find((candidate) => fs.existsSync(candidate)) ?? sharedPathCandidates[0];
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
'@shared': sharedComponentsPath,
|
|
},
|
|
},
|
|
server: {
|
|
host: '0.0.0.0',
|
|
port: 5176,
|
|
allowedHosts: ['sites.igny8.com', 'builder.igny8.com'],
|
|
fs: {
|
|
allow: [path.resolve(__dirname, '..'), sharedComponentsPath],
|
|
},
|
|
},
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
// Code-split builder routes to avoid loading in public sites
|
|
'builder': ['./src/builder/pages/wizard/WizardPage', './src/builder/pages/preview/PreviewCanvas', './src/builder/pages/dashboard/SiteDashboard'],
|
|
// Vendor chunks
|
|
'vendor-react': ['react', 'react-dom', 'react-router-dom'],
|
|
'vendor-ui': ['lucide-react', 'zustand'],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|