示例工程 14-module-resolution-import-maps
14-module-resolution-import-maps/03-circular-esm-cjs/cycle-fixed-b.js
点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。
// cycle-fixed-b.js —— 只在函数里读取 a,避免求值期 TDZ
import { getA } from './cycle-fixed-a.js';
export const bValue = 'b';
export function combined() {
return `${getA()}-${bValue}`;
}