From cca746686382f80f3a9307915d92669e9c3c6d5e Mon Sep 17 00:00:00 2001 From: Romain Monteil Date: Thu, 5 Nov 2020 15:18:19 +0100 Subject: [PATCH] [Encore] Fix CSS path --- frontend/encore/installation.rst | 2 +- frontend/encore/simple-example.rst | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/encore/installation.rst b/frontend/encore/installation.rst index 8241dbcd0b2..bbd6469a1c3 100644 --- a/frontend/encore/installation.rst +++ b/frontend/encore/installation.rst @@ -143,7 +143,7 @@ Next, open the new ``assets/app.js`` file which contains some JavaScript code */ // any CSS you import will output into a single css file (app.css in this case) - import '../css/app.css'; + import './styles/app.css'; // Need jQuery? Install it with "yarn add jquery", then uncomment to import it. // import $ from 'jquery'; diff --git a/frontend/encore/simple-example.rst b/frontend/encore/simple-example.rst index d0ed86a5922..23c215b1105 100644 --- a/frontend/encore/simple-example.rst +++ b/frontend/encore/simple-example.rst @@ -19,7 +19,7 @@ application: it will *require* all of the dependencies it needs (e.g. jQuery or import './styles/app.css'; - // var $ = require('jquery'); + // import $ from 'jquery'; Encore's job (via Webpack) is simple: to read and follow *all* of the ``require()`` statements and create one final ``app.js`` (and ``app.css``) that contains *everything* @@ -204,8 +204,8 @@ To import values, use ``import``: .. code-block:: diff // assets/app.js - - require('../css/app.css'); - + import '../css/app.css'; + - require('../styles/app.css'); + + import './styles/app.css'; - var $ = require('jquery'); + import $ from 'jquery'; @@ -292,8 +292,8 @@ file to ``app.scss`` and update the ``import`` statement: .. code-block:: diff // assets/app.js - - import '../css/app.css'; - + import '../css/app.scss'; + - import './styles/app.css'; + + import './styles/app.scss'; Then, tell Encore to enable the Sass pre-processor: