Skip to content

add a note about npm commands equivalent to yarn's #13861

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 22, 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
15 changes: 15 additions & 0 deletions frontend/encore/simple-example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,21 @@ To build the assets, run:

Stop and restart ``encore`` each time you update your ``webpack.config.js`` file.

.. note::

If you prefer npm, run these commands instead:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a choice sentence above, like for ex:
« Symfony is not linked to either Yarn neither NPM package manager for your frontend assets, choose the one you are fluent with, and use those command line respectively »
With link to both Yarn and NPM website
That way, it can avoid duplicating the code block and devs can understand they can use both command line for same output :)


.. code-block:: terminal

# compile assets once
$ npm run dev

# or, recompile assets automatically when files change
$ npm run watch

# on deploy, create a production build
$ npm run build

Congrats! You now have three new files:

* ``public/build/app.js`` (holds all the JavaScript for your "app" entry)
Expand Down