title: javascript modules and CORS
body: <p>I am trying to understand modules in JavaScript but when I try to write a very simple module I get CORS error.I am using bracket as my text editor and the odd part is when I'm using live preview in brackets the code works but when I normally open the <code>.js</code> file I get error.</p>
  
  <p>index.html </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
      &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt; JS &lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;script type="module"&gt;
              import {add} from './libA.js'; 
              console.log(add(10,20));
          &lt;/script&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>libA.js</p>
  
  <pre><code>export function add(a,b) {
          return a+b ;
      }
  </code></pre>
  
  <p>*I get this error ->    </p>
  
  <pre><code>Access to Script at 'file:///F:/WEB%20DEV/JavaScript/libA.js' from origin `null` has been blocked by CORS policy: 
  Invalid response. 
  Origin 'null' is therefore not allowed access.
  </code></pre>
  
  <p>(I even tried the latest version of chrome too)</p>