Skip to content

Commit

Permalink
feature #13664 [WCM] Adding info about Vue build (weaverryan)
Browse files Browse the repository at this point in the history
This PR was merged into the 5.0 branch.

Discussion
----------

[WCM] Adding info about Vue build

Docs for symfony/webpack-encore#769

Commits
-------

e7bff3f adding info about Vue build
  • Loading branch information
weaverryan committed May 13, 2020
2 parents 74d20fe + e7bff3f commit 4e7663f
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions frontend/encore/vuejs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,38 @@ Any ``.vue`` files that you require will be processed correctly. You can also
configure the `vue-loader options`_ by passing an options callback to
``enableVueLoader()``. See the `Encore's index.js file`_ for detailed documentation.

Runtime Compiler Build
----------------------

By default, Encore uses a Vue "build" that allows you to compile templates at
runtime. This means that you *can* do either of these:

.. code-block:: javascript
new Vue({
template: '<div>{{ hi }}</div>'
})
new Vue({
el: '#app', // where <div id="app"> in your DOM contains the Vue template
});
If you do *not* need this functionality (e.g. you use single file components),
then you can tell Encore to create a *smaller* and CSP-compliant build:

.. code-block:: javascript
// webpack.config.js
// ...
Encore
// ...
.enableVueLoader(() => {}, { runtimeCompilerBuild: false })
;
You can also silence the recommendation by passing ``runtimeCompilerBuild: true``.

Hot Module Replacement (HMR)
----------------------------

Expand Down

0 comments on commit 4e7663f

Please sign in to comment.