title: Vue.js - Is it possible to use Javascript Dynamic Imports to load components from another server?
body: <h1>Context</h1>
  <p>I have to create a Vue.js application as the UI of my REST API Back-end.
  It will be displayed for every client.</p>
  <p>This application displays a list of items to be handled (with a small workflow: open, in progress, done).</p>
  <p>Some of my clients request a specific and different view for this list: they want, for instance, that the list is displayed in another layout, or with extra data from their internal applications.</p>
  <h1>My idea</h1>
  <p>So, I have to create specific Vue.js components for these clients, but I don't want to &quot;pollute&quot; my main application code base with all the components for these clients.
  I want that these views are handled in a specifically dedicated code base.</p>
  <p>I was wondering if I could use Dynamic imports / Async components (<a href="https://itnext.io/vue-js-app-performance-optimization-part-1-introduction-to-performance-optimization-and-lazy-29e4ff101019" rel="nofollow noreferrer">Article on optimization with Dynamic imports</a> and <a href="https://v2.vuejs.org/v2/guide/components-dynamic-async.html#Async-Components" rel="nofollow noreferrer">Official Vue.js doc for Dynamic imports</a>) to load these components, based on the client that uses the application.
  These components would be loaded from <em><strong>another server</strong></em>, not the server that serves the main Vue.js application.</p>
  <hr />
  <p>The actual way of dynamically loading a component is:</p>
  <pre><code>'my-component': () =&gt; import('./my-async-component')
  </code></pre>
  <p>Would it be possible to do something like:</p>
  <pre><code>'my-component': () =&gt; import('http://myspecificclient.mydomain.com/my-async-component')
  </code></pre>
  <hr />
  <p>I understand that dynamic loading is related in particular with Webpack and that it could be an issue here, but I'm not skilled enough in Webpack to know if what I would like to do is relevant.</p>