title: vue.js - view index.html without a server
body: <p>I'm building an app with vue.js and this app needs to run later on a terminal without internet connection and without a running server. I want that my client just have to start the index.html file. Is this possible and what setup do i need?</p>
  
  <p>When i start the index.html my only error message in console i get is:
  Uncaught DOMException: Failed to construct 'Worker': Script at 'file:///xxx/dist/ec0098eb6371c2f4342a.worker.js' cannot be accessed from origin 'null'.</p>
  
  <p>my register-service-worker.js looks like this to allow localhost</p>
  
  <pre><code>if (
    process.env.NODE_ENV === 'production' &amp;&amp;
    ('https:' === location.protocol || location.host.match(/(localhost|127.0.0.1)/)) &amp;&amp;
    navigator.serviceWorker
  ) {
    navigator.serviceWorker.register('/service-worker.js');
  }
  </code></pre>
  
  <p>i try now for days to find a solution. I already build half of my app and now i see that
  it can't run locally. I hope someone knows a trick.
  Thanks from Germany</p>