mirror of
https://github.com/symfony/recipes.git
synced 2026-09-19 02:56:23 +03:00
100 lines
4.2 KiB
JSON
100 lines
4.2 KiB
JSON
{
|
|
"manifests": {
|
|
"symfony/ux-react": {
|
|
"manifest": {
|
|
"bundles": {
|
|
"Symfony\\UX\\React\\ReactBundle": [
|
|
"all"
|
|
]
|
|
},
|
|
"copy-from-recipe": {
|
|
"assets/": "assets/"
|
|
},
|
|
"conflict": {
|
|
"symfony/webpack-encore-bundle": "<2.0",
|
|
"symfony/flex": "<1.20.0 || >=2.0.0,<2.3.0"
|
|
},
|
|
"add-lines": [
|
|
{
|
|
"file": "webpack.config.js",
|
|
"content": "\n .enableReactPreset()",
|
|
"position": "after_target",
|
|
"target": ".splitEntryChunks()"
|
|
},
|
|
{
|
|
"file": "assets/app.js",
|
|
"content": "import { registerReactControllerComponents } from '@symfony/ux-react';",
|
|
"position": "top",
|
|
"warn_if_missing": true
|
|
},
|
|
{
|
|
"file": "assets/app.js",
|
|
"content": "registerReactControllerComponents(require.context('./react/controllers', true, /\\.(j|t)sx?$/));",
|
|
"position": "bottom",
|
|
"warn_if_missing": true,
|
|
"requires": "symfony/webpack-encore-bundle"
|
|
},
|
|
{
|
|
"file": "assets/app.js",
|
|
"content": "registerReactControllerComponents(import.meta.glob('./react/controllers/**/*.{jsx,tsx}', { eager: true }));",
|
|
"position": "bottom",
|
|
"warn_if_missing": true,
|
|
"requires": "symfony/reprise"
|
|
},
|
|
{
|
|
"file": "assets/app.js",
|
|
"content": "registerReactControllerComponents();",
|
|
"position": "bottom",
|
|
"warn_if_missing": true,
|
|
"requires": "symfony/asset-mapper"
|
|
}
|
|
],
|
|
"post-install-output": [
|
|
"",
|
|
" * Using <fg=green>Vite</>? Install <fg=green>@vitejs/plugin-react</> so Vite can compile JSX,",
|
|
" and register it in your <comment>vite.config</>:",
|
|
"",
|
|
" <fg=green>npm install --save-dev @vitejs/plugin-react</>",
|
|
"",
|
|
" import react from '@vitejs/plugin-react'",
|
|
"",
|
|
" export default defineConfig({",
|
|
" plugins: [",
|
|
" react(),",
|
|
" Symfony({ /* ... */ }),",
|
|
" ],",
|
|
" })",
|
|
"",
|
|
" * Using <fg=green>Rsbuild</>? Install <fg=green>@rsbuild/plugin-react</> and register it in your",
|
|
" <comment>rsbuild.config</>:",
|
|
"",
|
|
" <fg=green>npm install --save-dev @rsbuild/plugin-react</>",
|
|
"",
|
|
" import { pluginReact } from '@rsbuild/plugin-react'",
|
|
"",
|
|
" export default defineConfig({",
|
|
" plugins: [",
|
|
" pluginReact(),",
|
|
" Symfony({ /* ... */ }),",
|
|
" ],",
|
|
" })"
|
|
]
|
|
},
|
|
"files": {
|
|
"assets/react/controllers/Hello.jsx": {
|
|
"contents": [
|
|
"import React from 'react';",
|
|
"",
|
|
"export default function (props) {",
|
|
" return <div>Hello {props.fullName}</div>;",
|
|
"}",
|
|
""
|
|
],
|
|
"executable": false
|
|
}
|
|
},
|
|
"ref": "1fd6b362511456064d80779d8774707a685f6f1b"
|
|
}
|
|
}
|
|
}
|