Skip to content

[Encore] Fix CSS path #14520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/encore/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
10 changes: 5 additions & 5 deletions frontend/encore/simple-example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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*
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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:

Expand Down