示例工程 12-umd-systemjs
12-umd-systemjs/02-system-register/index.html
点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>12 · System.register 格式</title>
</head>
<body>
<p>打开 Console 查看最小 System.register 加载器的执行顺序。</p>
<script type="module">
import { createSystem, REGISTRY, run } from './main.js';
const events = [];
const load = createSystem(REGISTRY, (e) => events.push(e));
console.log('doubled =>', load('./main').doubled);
console.log('events =>', events.join(' → '));
run();
</script>
</body>
</html>