Skip to content

Conversation

pierredup
Copy link
Contributor

Add docs to register custom loaders for Encore

Closes #8053

Copy link
Member

@weaverryan weaverryan left a 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,
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

should be javascript

]
}
}
)
Copy link
Member

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...

@weaverryan
Copy link
Member

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

@weaverryan weaverryan closed this Jun 25, 2017
weaverryan added a commit that referenced this pull request Jun 26, 2017
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants