Does the code inside the js file gets run during the import? if yes, then once or each time?
e.g.
// a.js
console.log("A");
const a = "a";
export default a;
// b.js
import a from "./a"; // => console logs?
// c.js
import a from "./a"; // => console logs again?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…