- Replace @vitejs/plugin-react with @vitejs/plugin-react-swc to fix React Refresh preamble detection error in cross-origin Docker setup - Register React components manually via window.resolveReactComponent since ux-react's registerReactControllerComponents uses Webpack's require.context API which is incompatible with Vite Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
29 lines
597 B
JavaScript
29 lines
597 B
JavaScript
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react-swc';
|
|
import symfonyPlugin from 'vite-plugin-symfony';
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
react(),
|
|
symfonyPlugin(),
|
|
],
|
|
build: {
|
|
rollupOptions: {
|
|
input: {
|
|
app: './assets/app.js',
|
|
},
|
|
},
|
|
},
|
|
server: {
|
|
host: '0.0.0.0',
|
|
port: 5173,
|
|
strictPort: true,
|
|
origin: 'http://localhost:5173',
|
|
cors: true,
|
|
hmr: {
|
|
host: 'localhost',
|
|
port: 5173,
|
|
},
|
|
},
|
|
});
|