mirror of
https://github.com/symfony/recipes.git
synced 2026-09-11 23:26:27 +03:00
63 lines
2.4 KiB
JSON
63 lines
2.4 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();",
|
|
"position": "bottom",
|
|
"warn_if_missing": true,
|
|
"requires": "symfony/asset-mapper"
|
|
}
|
|
]
|
|
},
|
|
"files": {
|
|
"assets/react/controllers/Hello.jsx": {
|
|
"contents": [
|
|
"import React from 'react';",
|
|
"",
|
|
"export default function (props) {",
|
|
" return <div>Hello {props.fullName}</div>;",
|
|
"}",
|
|
""
|
|
],
|
|
"executable": false
|
|
}
|
|
},
|
|
"ref": "e970076b31d602ae6e2106cf91a82c7e1f7ddff2"
|
|
}
|
|
}
|
|
}
|