title: Loading an external script before loading components - Vue.js
body: <p>In my Vue project, I would like to load a script from a server (e. g. <code>https://myurl.com/API.js</code>). 
  The script contains a variable, which I would like to use in my Vue component (view).
  The problem is that when I load that scrip using the loadScript module:</p>
  
  <pre><code>import Vue from 'vue'
  import LoadScript from 'vue-plugin-load-script';
  
  Vue.use(LoadScript);
  Vue.loadScript('https://quvia.cz:4443/portalAPI.js')
  </code></pre>
  
  <p>It is then loaded after the Vue component, so when try to <code>console.log(externalScriptVariable)</code>, it is undefined. If I would setTimeout for 1 second, it would output the variable just fine.</p>
  
  <p>What can I do in Vue.js to <em>"await"</em> the script loading, so it would load before every other Vue component?</p>