If there has a common file named common.js, and others such as a.js, b.js...
common.js
const Common = { property: 'initial' }
export { Common };
a.js
import { Common } from 'common.js';
Common.property = 'changed';
b.js
import { Common } from 'common.js';
console.log(Common.property);
First, a.js runs and load the common.js into memory.
Then, b.js run by engine.
- Does the
common.jswill load again or use the existingcommon.jsin the memory? - If
common.jswas updated by otherxx.jsscript, how will theimportbehave?