From 2c8bc90536e9be2b606044124ad186fad0b38e8f Mon Sep 17 00:00:00 2001 From: Kevin Bond Date: Mon, 15 Apr 2024 09:11:02 -0400 Subject: [PATCH] [AssetMapper][Encore] document switching from AssetMapper to Encore --- frontend.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/frontend.rst b/frontend.rst index 6b7aa6f5048..05f7e6c69df 100644 --- a/frontend.rst +++ b/frontend.rst @@ -78,6 +78,26 @@ pre-processing CSS & JS and compiling and minifying assets. :doc:`Read the Encore Documentation ` +Switch from AssetMapper +^^^^^^^^^^^^^^^^^^^^^^^ + +By default, new Symfony webapp projects (created with ``symfony new --webapp myapp``) +use AssetMapper. If you still need to use Webpack Encore, use the following steps to +switch. This is best done on a new project and provides the same features (Turbo/Stimulus) +as the default webapp. + +.. code-block:: terminal + + # Remove AssetMapper & Turbo/Stimulus temporarily + $ composer remove symfony/ux-turbo symfony/asset-mapper symfony/stimulus-bundle + + # Add Webpack Encore & Turbo/Stimulus back + $ composer require symfony/webpack-encore-bundle symfony/ux-turbo symfony/stimulus-bundle + + # Install & Build Assets + $ npm install + $ npm run dev + Stimulus & Symfony UX Components ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~