- Created LayoutWrapper component to conditionally render header/footer based on route - Created MinimalHeader component (logo only) - Created MinimalFooter component (trust badges + policy links) - Created usePageVisibility hook to get visibility settings per page - Wrapped ClassicLayout with LayoutWrapper for conditional rendering - Header/footer visibility now controlled directly in React SPA - Settings: show/minimal/hide for both header and footer - Background color support for checkout and thankyou pages
52 lines
1.4 KiB
TypeScript
52 lines
1.4 KiB
TypeScript
import react from '@vitejs/plugin-react';
|
|
import { defineConfig } from 'vite';
|
|
import { readFileSync } from 'fs';
|
|
import { resolve, dirname } from 'path';
|
|
import { fileURLToPath } from 'url';
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = dirname(__filename);
|
|
|
|
const key = readFileSync(resolve(__dirname, '../admin-spa/.cert/woonoow.local-key.pem'));
|
|
const cert = readFileSync(resolve(__dirname, '../admin-spa/.cert/woonoow.local-cert.pem'));
|
|
|
|
export default defineConfig({
|
|
base: './',
|
|
publicDir: 'public',
|
|
plugins: [
|
|
react({
|
|
jsxRuntime: 'automatic',
|
|
})
|
|
],
|
|
resolve: { alias: { '@': resolve(__dirname, './src') } },
|
|
server: {
|
|
host: 'woonoow.local',
|
|
port: 5174,
|
|
strictPort: true,
|
|
https: { key, cert },
|
|
cors: {
|
|
origin: ['https://woonoow.local', 'https://woonoow.local:5174'],
|
|
credentials: true,
|
|
},
|
|
headers: {
|
|
'Access-Control-Allow-Origin': '*',
|
|
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
|
|
'Access-Control-Allow-Headers': 'X-Requested-With, content-type, Authorization',
|
|
},
|
|
hmr: {
|
|
protocol: 'wss',
|
|
host: 'woonoow.local',
|
|
port: 5174,
|
|
clientPort: 5174,
|
|
}
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
emptyOutDir: true,
|
|
rollupOptions: {
|
|
input: { app: 'src/main.tsx' },
|
|
output: { entryFileNames: 'app.js', assetFileNames: 'app.[ext]' }
|
|
}
|
|
}
|
|
});
|