If module is referenced by index.html, all js below that module can use the function without referenced module, even needn’t import and module.js needn’t export.
If module.js doesn’t be referenced by index.html, other js can only import module.js function and which also need to export.
Because moduleC.js is upper than main.js, so ccc first. And I guess all code should waiting the module loaded then run. First, import moduleA in faster than moduleB in main.js, and moduleB is referenced by moduleA. So it will output bbb first, then aaa. And moduleB.js has been referenced, so it wouldn’t occur again even main.js refer it.