@@ -22,8 +22,8 @@ Your ``composer.json`` file must have the ``symfony-ux`` keyword:
22
22
Assets location
23
23
---------------
24
24
25
- Your assets must be located in one of the following directories, with a `` package.json `` file so Flex can handle it
26
- during install/update:
25
+ Your assets must be located in one of the following directories, with a
26
+ `` package.json `` file so Flex can handle it during install/update:
27
27
28
28
* ``/assets `` (recommended)
29
29
* ``/Resources/assets ``
@@ -32,9 +32,9 @@ during install/update:
32
32
package.json file
33
33
-----------------
34
34
35
- Your ``package.json `` file must contain a ``symfony `` config with controllers defined, and also add required packages
36
- to the ``peerDependencies `` and ``importmap `` (the list of packages in `` importmap `` should be the same as the ones
37
- in ``peerDependencies ``):
35
+ Your ``package.json `` file must contain a ``symfony `` config with controllers defined,
36
+ and also add required packages to the ``peerDependencies `` and ``importmap `` (the list
37
+ of packages in `` importmap `` should be the same as the ones in ``peerDependencies ``):
38
38
39
39
.. code-block :: json
40
40
@@ -68,8 +68,8 @@ In this case, the file located at ``[assets directory]/dist/controller.js`` will
68
68
69
69
.. tip ::
70
70
71
- You can either write raw JS in this ``dist/controller.js `` file, or you can e.g. write your controller with
72
- TypeScript and transpile it to JavaScript.
71
+ You can either write raw JS in this ``dist/controller.js `` file, or you can
72
+ e.g. write your controller with TypeScript and transpile it to JavaScript.
73
73
74
74
Here is an example to do so:
75
75
@@ -92,7 +92,8 @@ In this case, the file located at ``[assets directory]/dist/controller.js`` will
92
92
}
93
93
}
94
94
95
- 2. Add the following to your ``babel.config.js `` file (should be located next to your ``package.json `` file):
95
+ 2. Add the following to your ``babel.config.js `` file (should be located next
96
+ to your ``package.json `` file):
96
97
97
98
.. code-block :: javascript
98
99
@@ -113,7 +114,8 @@ In this case, the file located at ``[assets directory]/dist/controller.js`` will
113
114
114
115
4. Write your Stimulus controller with TypeScript in ``src/controller.ts ``.
115
116
116
- 5. Run ``npm run build `` or ``yarn run build `` to transpile your TypeScript controller into JavaScript.
117
+ 5. Run ``npm run build `` or ``yarn run build `` to transpile your TypeScript
118
+ controller into JavaScript.
117
119
118
120
To use your controller in a template (e.g. one defined in your bundle) you can use it like this:
119
121
@@ -160,8 +162,9 @@ autoimport List of files to be imported with the controller. Useful e.g
160
162
Specifics for Asset Mapper
161
163
--------------------------
162
164
163
- To make your bundle's assets work with Asset Mapper, you must add the ``importmap `` config like above in your
164
- ``package.json `` file, and prepend some configuration to the container::
165
+ To make your bundle's assets work with AssetMapper, you must add the ``importmap ``
166
+ config like above in your ``package.json `` file, and prepend some configuration
167
+ to the container::
165
168
166
169
namespace Acme\FeatureBundle;
167
170
0 commit comments