html 파일에
<body>
<script type="module">
import a from '/library.js';
console.log(a);
</script>
</body>
library.js 파일에
var a = 10;
export default a;
이렇게 했는데
Access to script at 'file:///C:/library.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.
GET file:///C:/library.js net::ERR_FAILED
콘솔에서 이런 메시지가 나옵니다..
바탕화면에서 작업하는데 파일 둘 다 같은 위치에 저장해놓은 상태입니다ㅠ