update frontend ui chages
This commit is contained in:
@@ -1,57 +1,38 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import path from 'path'
|
||||
import { visualEditPlugin } from './vite-plugins/visual-edit-plugin.js'
|
||||
import { errorOverlayPlugin } from './vite-plugins/error-overlay-plugin.js'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig(({ mode }) => {
|
||||
return {
|
||||
plugins: [
|
||||
mode === 'development' && visualEditPlugin(),
|
||||
react(),
|
||||
errorOverlayPlugin(),
|
||||
{
|
||||
name: 'iframe-hmr',
|
||||
configureServer(server) {
|
||||
server.middlewares.use((req, res, next) => {
|
||||
// Allow iframe embedding
|
||||
res.setHeader('X-Frame-Options', 'ALLOWALL');
|
||||
res.setHeader('Content-Security-Policy', "frame-ancestors *;");
|
||||
next();
|
||||
});
|
||||
}
|
||||
}
|
||||
].filter(Boolean),
|
||||
server: {
|
||||
host: '0.0.0.0', // Bind to all interfaces for container access
|
||||
port: 5174,
|
||||
strictPort: true,
|
||||
// Allow all hosts - essential for Modal tunnel URLs
|
||||
allowedHosts: true,
|
||||
watch: {
|
||||
// Enable polling for better file change detection in containers
|
||||
usePolling: true,
|
||||
interval: 100, // Check every 100ms for responsive HMR
|
||||
},
|
||||
hmr: {
|
||||
protocol: 'wss',
|
||||
clientPort: 443
|
||||
}
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
server: {
|
||||
host: '0.0.0.0', // Bind to all interfaces so the dev server is reachable in a container
|
||||
port: 5174,
|
||||
strictPort: true,
|
||||
allowedHosts: true,
|
||||
watch: {
|
||||
// Polling makes file changes reliable inside containers and VMs
|
||||
usePolling: true,
|
||||
interval: 100,
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, './src'),
|
||||
},
|
||||
extensions: ['.mjs', '.js', '.jsx', '.ts', '.tsx', '.json']
|
||||
},
|
||||
preview: {
|
||||
host: '0.0.0.0',
|
||||
port: 4173,
|
||||
allowedHosts: true,
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, './src'),
|
||||
},
|
||||
optimizeDeps: {
|
||||
include: ['react', 'react-dom'],
|
||||
esbuildOptions: {
|
||||
loader: {
|
||||
'.js': 'jsx',
|
||||
},
|
||||
extensions: ['.mjs', '.js', '.jsx', '.ts', '.tsx', '.json']
|
||||
},
|
||||
optimizeDeps: {
|
||||
include: ['react', 'react-dom'],
|
||||
esbuildOptions: {
|
||||
loader: {
|
||||
'.js': 'jsx',
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user