I have static files in django call it A.js and B.js
in A.js
I have for example for constant like
const variable = "Hello, World"
export {variable}
in B.js
I have:
import {variable} from './A.js'
Kindly note that both files are in the static files directory of django project.
My question is how am I going to import successfully the variable so that it checks into variable and use them in the template without getting exceptions
Uncaught SyntaxError: Unexpected token 'export' and the whole JS does not work
I also needed to declare them as modules inside the template
<script src='{% static "js/A.js" %}' type="module" ></script>
<script src='{% static "js/B.js" %}' type="module" ></script>
either ways not working. I have previously used export default
approach , still not working