-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Frontend] Add docs for custom loaders #8083
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this! We just need some minor tweaks :)
Adding Custom Loaders | ||
===================== | ||
|
||
Encore already comes with a variety of different loaders that you can use out of the box, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... out of the box. But if...
===================== | ||
|
||
Encore already comes with a variety of different loaders that you can use out of the box, | ||
but if there is a specific loader that you want to use that is not currently supported, then you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
supported, you can add your own loader...
can easily add your own loader through the ``addLoader`` function. | ||
The ``addLoader`` takes any valid webpack rules config. | ||
|
||
If, for example, you want to add the `handlebars-loader`_, you can just ``addLoader`` with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, call
addLoader
with...
Since the loader config accepts any valid Webpack rules object, you can pass any | ||
additional information your need for the loader | ||
|
||
.. code-block:: twig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be javascript
] | ||
} | ||
} | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CS on this isn't quite right yet...
I've actually just made this part of my #8084 so that I can use some of your changes :). I'll merge your stuff there |
This PR was merged into the 3.3 branch. Discussion ---------- Various Encore updates Closes: * #8053 * #8067 * #8069 * #8071 * #8070 * #8072 Replaces #8083 Commits ------- 15e816e Tweaks thanks to Javier f8461d3 adding anotehr faq for old packages without a main script f5c22a6 minor rewording a0982ec [Encore] Adding more FAQs for #8072 807b83f [Encore] Documenting addPlugin - see #8070 a099bff Documenting (better) how to expose global variables - see #8071 8b0a22a [Encore] Adding docs about deploying to a subdirectory - see #8069 62dd63e Adding docs about adding custom config - see #8067 0ff1c3c Add missing link to handlebars-loader 3d9905e Add docs for custom loaders
Add docs to register custom loaders for Encore
Closes #8053