Skip to content

Add parentheses after require() function name #12549

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
Oct 29, 2019
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
10 changes: 5 additions & 5 deletions frontend/encore/simple-example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CSS and one JS file, organized into an ``assets/`` directory:
With Encore, think of your ``app.js`` file like a standalone JavaScript
application: it will *require* all of the dependencies it needs (e.g. jQuery or React),
*including* any CSS. Your ``app.js`` file is already doing this with a special
``require`` function:
``require()`` function:

.. code-block:: javascript

Expand All @@ -21,7 +21,7 @@ application: it will *require* all of the dependencies it needs (e.g. jQuery or

// var $ = require('jquery');

Encore's job (via Webpack) is simple: to read and follow *all* of the ``require``
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*
your app needs. Encore can do a lot more: minify files, pre-process Sass/LESS,
support React, Vue.js, etc.
Expand Down Expand Up @@ -51,7 +51,7 @@ of your project. It already holds the basic config you need:
// ...

They *key* part is ``addEntry()``: this tells Encore to load the ``assets/js/app.js``
file and follow *all* of the ``require`` statements. It will then package everything
file and follow *all* of the ``require()`` statements. It will then package everything
together and - thanks to the first ``app`` argument - output final ``app.js`` and
``app.css`` files into the ``web/build`` directory.

Expand Down Expand Up @@ -120,7 +120,7 @@ be executed. All the CSS files that were required will also be displayed.

The ``encore_entry_link_tags()`` and ``encore_entry_script_tags()`` functions
read from an ``entrypoints.json`` file that's generated by Encore to know the exact
filename(s) to render . This file is *especially* useful because you can
filename(s) to render. This file is *especially* useful because you can
:doc:`enable versioning</frontend/encore/versioning>` or
:doc:`point assets to a CDN</frontend/encore/cdn>` without making *any* changes to your
template: the paths in ``entrypoints.json`` will always be the final, correct paths.
Expand Down Expand Up @@ -179,7 +179,7 @@ added to the output file (``app.js``). Refresh to see the message!
The import and export Statements
--------------------------------

Instead of using ``require`` and ``module.exports`` like shown above, JavaScript
Instead of using ``require()`` and ``module.exports`` like shown above, JavaScript
provides an alternate syntax based on the `ECMAScript 6 modules`_ that includes
the ability to use dynamic imports.

Expand Down