Skip to content

Commit 25d325e

Browse files
committed
[AssetMapper][Encore] document switching from AssetMapper to Encore
1 parent 2deff6d commit 25d325e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

frontend.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,26 @@ pre-processing CSS & JS and compiling and minifying assets.
7878

7979
:doc:`Read the Encore Documentation </frontend/encore/index>`
8080

81+
Switch from Asset Mapper
82+
^^^^^^^^^^^^^^^^^^^^^^^^
83+
84+
By default, new Symfony _webapp_ projects (created with ``symfony new --webapp myapp``)
85+
use AssetMapper. If you still need to use Webpack Encore, use the following steps to
86+
switch. This is best done on a new project and provides the same features (Turbo/Stimulus)
87+
as the default webapp.
88+
89+
.. code-block:: terminal
90+
91+
# Remove AssetMapper & Turbo/Stimulus temporarily
92+
$ composer remove symfony/ux-turbo symfony/asset-mapper symfony/stimulus-bundle
93+
94+
# Add Webpack Encore & Turbo/Stimulus back
95+
$ composer require symfony/webpack-encore-bundle symfony/ux-turbo symfony/stimulus-bundle
96+
97+
# Install & Build Assets
98+
$ npm install
99+
$ npm run dev
100+
81101
Stimulus & Symfony UX Components
82102
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
83103

0 commit comments

Comments
 (0)