fix: switch to @vitejs/plugin-react-swc and manual component registration

- 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>
This commit is contained in:
thibaud-leclere
2026-03-28 13:40:16 +01:00
parent 04301642bc
commit a6064c2bdb
4 changed files with 304 additions and 5 deletions

View File

@@ -15,7 +15,7 @@
"react-dom": "^19.0"
},
"devDependencies": {
"@vitejs/plugin-react": "^4.3",
"@vitejs/plugin-react-swc": "^4.3.0",
"vite": "^6.0",
"vite-plugin-symfony": "^8.0"
}