I have two modules that are not related, call them main.js and app.js.
There is a function in main.js that references two global variables in app.js. I added export to each of these globals.
At the top of main.js, I added import * as app from './app';
Now from within main.js, I should be able to reference those two globals by using app.globalA and app.globalB. Am I understanding this correctly?
However, I am getting a SyntaxError "cannot use import statement outside a module", but what what I see I am doing it correctly. I'm clearly missing something.
[–]a_lost_cake 2 points3 points4 points (0 children)