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.js
will load again or use the existingcommon.js
in the memory? - If
common.js
was updated by otherxx.js
script, how will theimport
behave?