Skip to content

Commit 5c5938f

Browse files
committed
Adding note about configuring options
1 parent 872bf93 commit 5c5938f

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

frontend/encore/dev-server.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ by the normal `webpack-dev-server`_. For example:
2424
2525
This will start a server at ``https://localhost:9000``.
2626

27-
Hot Module Replace HMR
28-
----------------------
27+
Hot Module Replacement HMR
28+
--------------------------
2929

3030
Encore *does* support `HMR`_, but only in some areas. To activate it, pass the ``--hot``
3131
option:

frontend/encore/vuejs.rst

+14-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,18 @@ Then, activate the ``vue-loader`` in ``webpack.config.js``:
2121
+ .enableVueLoader()
2222
;
2323
24-
That's it! Any ``.vue`` files that you require will be processed correctly.
24+
That's it! Any ``.vue`` files that you require will be processed correctly. You can
25+
also configure the `vue-loader options`_ via a callback:
26+
27+
.. code-block:: javascript
28+
29+
.enableVueLoader(function(options) {
30+
// https://vue-loader.vuejs.org/en/configurations/advanced.html
31+
32+
options.preLoaders = {
33+
js: '/path/to/custom/loader'
34+
};
35+
});
2536
2637
Hot Module Replacement (HMR)
2738
----------------------------
@@ -41,4 +52,5 @@ updated styles still requires a page refresh.
4152
See :doc:`/frontend/encore/dev-server` for more details.
4253

4354
.. _`babel-preset-react`: https://babeljs.io/docs/plugins/preset-react/
44-
.. _`Vue.js`: https://vuejs.org/
55+
.. _`Vue.js`: https://vuejs.org/
56+
.. _`vue-loader options`: https://vue-loader.vuejs.org/en/configurations/advanced.html

0 commit comments

Comments
 (0)