From d038917e6b564649b0917dce9f570624cb6a026b Mon Sep 17 00:00:00 2001 From: Abdouni Abdelkarim Date: Sat, 30 May 2020 10:41:20 +0200 Subject: [PATCH] Update installation.rst update code --- frontend/encore/installation.rst | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/frontend/encore/installation.rst b/frontend/encore/installation.rst index b39fec3a296..f0d2575d4d2 100644 --- a/frontend/encore/installation.rst +++ b/frontend/encore/installation.rst @@ -98,14 +98,24 @@ is the main config file for both Webpack and Webpack Encore: module.exports = Encore.getWebpackConfig(); -Next, create a new ``assets/js/app.js`` file with some basic JavaScript *and* -import some JavaScript: +Next, open the new ``assets/js/app.js`` file which contains some JavaScript code +*and* imports some CSS: .. code-block:: javascript // assets/js/app.js - - require('../css/app.css'); + /* + * Welcome to your app's main JavaScript file! + * + * We recommend including the built version of this JavaScript file + * (and its CSS file) in your base layout (base.html.twig). + */ + + // any CSS you import will output into a single css file (app.css in this case) + import '../css/app.css'; + + // Need jQuery? Install it with "yarn add jquery", then uncomment to import it. + // import $ from 'jquery'; console.log('Hello Webpack Encore');