Skip to content

Commit fec3fa0

Browse files
committed
minor #17596 Clarifying not about Encore outside of Symfony (weaverryan)
This PR was submitted for the 6.2 branch but it was squashed and merged into the 5.4 branch instead. Discussion ---------- Clarifying not about Encore outside of Symfony Hi! Closes symfony/webpack-encore#1169 and closes #17578 Cheers! Commits ------- 7726f6b Clarifying not about Encore outside of Symfony
2 parents 2f6dcff + 7726f6b commit fec3fa0

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

frontend/encore/installation.rst

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ is the main config file for both Webpack and Webpack Encore:
139139
140140
module.exports = Encore.getWebpackConfig();
141141
142+
Creating Other Supporting File
143+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
144+
142145
Next, open the new ``assets/app.js`` file which contains some JavaScript code
143146
*and* imports some CSS:
144147

@@ -185,7 +188,7 @@ a system that you'll learn about soon:
185188
// register any custom, 3rd party controllers here
186189
// app.register('some_controller_name', SomeImportedController);
187190
188-
And finally, create an ``assets/controllers.json`` file, which also fits into
191+
Then create an ``assets/controllers.json`` file, which also fits into
189192
the Stimulus system:
190193

191194
.. code-block:: json
@@ -195,6 +198,18 @@ the Stimulus system:
195198
"entrypoints": []
196199
}
197200
201+
Finally, though it's optional, add the following ``scripts`` to your ``package.json``
202+
file so you can run the same commands in the rest of the documentation:
203+
204+
.. code-block:: json
205+
206+
"scripts": {
207+
"dev-server": "encore dev-server",
208+
"dev": "encore dev",
209+
"watch": "encore dev --watch",
210+
"build": "encore production --progress"
211+
}
212+
198213
You'll customize and learn more about these files in :doc:`/frontend/encore/simple-example`.
199214
When you execute Encore, it will ask you to install a few more dependencies based
200215
on which features of Encore you have enabled.

frontend/encore/simple-example.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,10 @@ template: the paths in ``entrypoints.json`` will always be the final, correct pa
154154
And if you use :doc:`splitEntryChunks() </frontend/encore/split-chunks>` (where Webpack splits the output into even
155155
more files), all the necessary ``script`` and ``link`` tags will render automatically.
156156

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

161162
.. versionadded:: 1.9.0
162163

0 commit comments

Comments
 (0)