Adding new recipes for Encore, Stimulus & AssetMapper (#1202)

* Adding new recipes for Encore, Stimulus & AssetMapper

* StimulusBundle 1.0 -> 2.9

* updating namespace

* moving encore recipe changes to 2.0

* conflict with older version of flex

* adding ux_controller_link_tags() to recipe

* adding documentation to importmap

* updating message to match core

* Adding ux translator

* fixing translations path

* Documenting the new add-lines configurator

* Fixing translator initial version

* shorten to just var

* remove ux alias - there is no one package to install UX packages currently

* fixing wrong package name
This commit is contained in:
Ryan Weaver
2023-05-27 01:35:12 +02:00
committed by GitHub
parent 6d4e120add
commit c590fdaa8e
29 changed files with 459 additions and 1 deletions
+38
View File
@@ -313,6 +313,44 @@ colors`_ are supported too:
* <fg=blue>Read</> the documentation at <comment>https://symfony.com/doc</>
``add-lines`` Configurator
~~~~~~~~~~~~~~~~~~~~~~~~~~
If no other configurators can meet your needs, the ``add-lines`` configurator
can add entire lines to files, either at the top, bottom or after a target:
.. code-block:: json
"add-lines": [
{
"file": "webpack.config.js",
"content": "\nenables the Symfony UX Stimulus bridge (used in assets/bootstrap.js)\n .enableStimulusBridge('./assets/controllers.json')",
"position": "after_target",
"target": ".splitEntryChunks()"
},
{
"file": "assets/app.js",
"content": "import './bootstrap.js';",
"position": "top",
"warn_if_missing": true
},
{
"file": "assets/translator.js",
"content": "export * from '../var/translations';",
"position": "bottom",
"requires": "symfony/webpack-encore-bundle"
}
]
Each item needs ``file``, ``content`` and ``position``, which can be
``top``, ``bottom`` or ``after_target``. If ``after_target`` is used, a
``target`` must also be specified, which is a string that will be searched for
in the file.
If ``warn_if_missing`` is set to ``true``, a warning will be shown to the
user if the ``file`` or ``target`` isn't found. If ``requires`` is set, the
rule will only be applied if the given package is installed.
Validation
----------