Skip to content

Update installation.rst #13734

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
Jun 3, 2020
Merged
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
18 changes: 14 additions & 4 deletions frontend/encore/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down