I am working on a project that has multiple .js file for containing different functions. I want to use the function from M1.js in M2.js and what I am doing is exporting the function from M1.js and importing in M2.js.
The export works fine, but the issue is when I import function.
M1.js
--export {function}
M2.js
--import {function} from './M1.js'
<script type="module" href="{% static 'myapp/M1.js'%}
<script type="module" href="{% static 'myapp/M2.js'%}
Above is the code that generate following error on import
Loading module from “app.com/static/Invoicing/exif_js” was blocked because of a disallowed MIME type (“text/html”).
My directory structure is
-Project
|--project
|--Invoicing (App)
|--static
|--Invoicing
|--M1.js
|--M2.js
|--templates
|--etc
|--static
|--etc