chore: configure vite, react, and stimulus bootstrap

This commit is contained in:
thibaud-leclere
2026-03-28 13:11:41 +01:00
parent bd3996f4a9
commit f7a9be6a38
7 changed files with 58 additions and 5 deletions

2
assets/app.js Normal file
View File

@@ -0,0 +1,2 @@
import './bootstrap.js';
import './styles/app.css';

6
assets/bootstrap.js vendored Normal file
View File

@@ -0,0 +1,6 @@
import { startStimulusApp } from '@symfony/stimulus-bundle';
import { registerReactControllerComponents } from '@symfony/ux-react';
const app = startStimulusApp();
registerReactControllerComponents(require.context('./react/controllers', true, /\.(j|t)sx?$/));

View File

@@ -9,6 +9,12 @@
"enabled": false,
"fetch": "eager"
}
},
"@symfony/ux-react": {
"react": {
"enabled": true,
"fetch": "eager"
}
}
},
"entrypoints": []

View File

@@ -1,5 +0,0 @@
import { startStimulusApp } from '@symfony/stimulus-bundle';
const app = startStimulusApp();
// register any custom, 3rd party controllers here
// app.register('some_controller_name', SomeImportedController);

0
assets/styles/app.css Normal file
View File

21
package.json Normal file
View File

@@ -0,0 +1,21 @@
{
"name": "ltbxd-actorle",
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build"
},
"dependencies": {
"@floating-ui/react": "^0.27",
"@hotwired/stimulus": "^3.2",
"@hotwired/turbo": "^7.3",
"@symfony/stimulus-bundle": "file:vendor/symfony/stimulus-bundle/assets",
"@symfony/ux-react": "file:vendor/symfony/ux-react/assets",
"react": "^19.0",
"react-dom": "^19.0"
},
"devDependencies": {
"@vitejs/plugin-react": "^4.3",
"vite": "^6.0"
}
}

23
vite.config.js Normal file
View File

@@ -0,0 +1,23 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
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',
},
});