title: On-demand rendering of precompiled Vue.js components (webpack 2)
body: <p>I'm trying to on-demand render vue components. Application consists of 4 parts, each should be rendered to the DOM only after calling some function, something like <code>renderProducts()</code></p>
  
  <p>I'm using webpack 2 with latest vue-loader (+ Vuex, Vuei18n, ...)
  The problem is, this only works when using standalone build (with webpack alias for vue: <code>vue: 'vue/dist/vue.js'</code>).</p>
  
  <p>But I think I can do better, and use runtime-only build (and save some kilobytes).</p>
  
  <p>Anyone knows, what am I doing wrong?
  Here's my application entrypoint (showing only relevant parts):</p>
  
  <pre><code>import './index.scss';
  import Vue from 'vue';
  
  import MenusComponent from './components/menus/_menus-root.vue';
  import CartComponent from './components/cart/_cart-root.vue';
  import NavigationComponent from './components/navigation/_navigation-root.vue';
  import LocationInfoComponent from './components/location-info/_location-info-root.vue';
  
  ...
  
  const menus = new Vue({ name: 'menus-root', render: h =&gt; h(MenusComponent), store });
  const cart = new Vue({ name: 'cart-root', render: h =&gt; h(CartComponent), store });
  const navigation = new Vue({ name: 'navigation-root', render: h =&gt; h(NavigationComponent), store });
  const locationInfo = new Vue({ name: 'location-info-root', render: h =&gt; h(LocationInfoComponent), store });
  
  ...
  
  window.renderMenus = ({ el }) =&gt; {
    menus.$mount(el);
  },
  window.renderCart = ({ el }) =&gt; {
    cart.$mount(el);
  },
  window.renderNavigation = ({ el }) =&gt; {
    navigation.$mount(el);
  },
  window.renderLocationInfo = ({ el }) =&gt; {
    locationInfo.$mount(el);
  }
  </code></pre>
  
  <p>Thanks for any help or suggestion!</p>