diff --git a/frontend/encore/installation.rst b/frontend/encore/installation.rst index bcd59f8395e..118e15e7b0e 100644 --- a/frontend/encore/installation.rst +++ b/frontend/encore/installation.rst @@ -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: @@ -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 @@ -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. diff --git a/frontend/encore/simple-example.rst b/frontend/encore/simple-example.rst index 9a8f89e9b06..c2fc50289a5 100644 --- a/frontend/encore/simple-example.rst +++ b/frontend/encore/simple-example.rst @@ -154,9 +154,10 @@ template: the paths in ``entrypoints.json`` will always be the final, correct pa And if you use :doc:`splitEntryChunks() ` (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