diff --git a/frontend/encore/vuejs.rst b/frontend/encore/vuejs.rst index a79755b2ff7..0b1095b5f8d 100644 --- a/frontend/encore/vuejs.rst +++ b/frontend/encore/vuejs.rst @@ -40,7 +40,118 @@ updated styles still requires a page refresh. See :doc:`/frontend/encore/dev-server` for more details. +JSX Support +----------- + +You can enable `JSX with Vue.js`_ by configuring the 2nd parameter of the ``.enableVueLoader()`` method: + +.. code-block:: diff + + // webpack.config.js + // ... + + Encore + // ... + .addEntry('main', './assets/main.js') + + - .enableVueLoader() + + .enableVueLoader(() => {}, { + + useJsx: true + + }) + ; + +Next, run or restart Encore. When you do, you will see an error message helping you +install any missing dependencies. After running that command and restarting +Encore, you're done! + +Your ``.jsx`` files will now be transformed through ``@vue/babel-preset-jsx``. + +Using styles +~~~~~~~~~~~~ + +You can't use ``