Skip to content

Clarifying not about Encore outside of Symfony #17596

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
Dec 22, 2022
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
17 changes: 16 additions & 1 deletion frontend/encore/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ is the main config file for both Webpack and Webpack Encore:

module.exports = Encore.getWebpackConfig();

Creating Other Supporting File
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Next, open the new ``assets/app.js`` file which contains some JavaScript code
*and* imports some CSS:

Expand Down Expand Up @@ -185,7 +188,7 @@ a system that you'll learn about soon:
// register any custom, 3rd party controllers here
// app.register('some_controller_name', SomeImportedController);

And finally, create an ``assets/controllers.json`` file, which also fits into
Then create an ``assets/controllers.json`` file, which also fits into
the Stimulus system:

.. code-block:: json
Expand All @@ -195,6 +198,18 @@ the Stimulus system:
"entrypoints": []
}

Finally, though it's optional, add the following ``scripts`` to your ``package.json``
file so you can run the same commands in the rest of the documentation:

.. code-block:: json

"scripts": {
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production --progress"
}

You'll customize and learn more about these files in :doc:`/frontend/encore/simple-example`.
When you execute Encore, it will ask you to install a few more dependencies based
on which features of Encore you have enabled.
Expand Down
7 changes: 4 additions & 3 deletions frontend/encore/simple-example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,10 @@ template: the paths in ``entrypoints.json`` will always be the final, correct pa
And if you use :doc:`splitEntryChunks() </frontend/encore/split-chunks>` (where Webpack splits the output into even
more files), all the necessary ``script`` and ``link`` tags will render automatically.

If you're *not* using Symfony, you can ignore the ``entrypoints.json`` file and
point to the final, built file directly. ``entrypoints.json`` is only required for
some optional features.
If you are not using Symfony you won't have the ``encore_entry_*`` functions available.
Instead, you can point directly to the final built files or write code to parse
``entrypoints.json`` manually. The entrypoints file is needed only if you're using
certain optional features, like ``splitEntryChunks()``.

.. versionadded:: 1.9.0

Expand Down