title: How to create a Single Entry JS File for VueJS
body: <p>I have a project in Vue that is going to be big, so we are splitting the code in chunks with Webpack configuration, but when I build the project with <code>vue-cli-service</code>, it generates an <code>index.html</code> that prefetches/preloads all the chunks. I don't want to use this <code>index.html</code>. I need a single entry file for Vue that will start the app and import the other files as requested.</p>
  
  <p>I tried <code>splitChunks: false</code> in Webpack, but it didn't help:</p>
  
  <pre class="lang-js prettyprint-override"><code>configureWebpack: {
     optimization: {
       splitChunks: false
     }
  }
  </code></pre>
  
  <p>Tried removing the other imports and keeping only the <code>app.js</code>, but that also didn't help.</p>
  
  <p>We are using <code>import(/* webpackChunkName: "login" */ './views/Login.vue')</code>, but not in all components.</p>
  
  <p>I previously had another Vue project that worked the way I want: only an <code>app.js</code> and a <code>vendor.js</code> that import other chunks as needed. Back then, I wasn't using <code>vue-cli-service</code>; rather just a simple Webpack config and <code>System.import( /* webpackChunkName: "Login" */ '@/components/pages/login/Login.vue')</code> in all components that import the route files:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;html&gt;
  ...
      &lt;body&gt;
          &lt;div id=app&gt;&lt;/div&gt;
          &lt;script type=text/javascript src=/static/js/vendor.2f58f4045cb046ff1dac.js&gt;
          &lt;/script&gt;
          &lt;script type=text/javascript src=/static/js/app.877179012e83c1c97b77.js&gt;
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I would like to build my project and have a single JS file that I can import in another HTML file, and it will act as a starter file.</p>
  
  <p>Do I just need the <code>System.import</code> in all imports? Any other configurations with <code>vue-cli-service</code>?</p>