✅外部ライブラリ読み込みとindex.jsをesmにする
from
rund3
addEventListener("load", ...)
が不要になる
<script>
の数が減る
コードのイメージ
code:js
import htm from "
https://cdn.jsdelivr.net/npm/htm@3.1.1/+esm";
import * as Preact from "
https://cdn.jsdelivr.net/npm/preact@10.12.0/+esm";
import * as Hooks from "
https://cdn.jsdelivr.net/npm/preact@10.12.0/hooks/+esm";
import * as d3 from "
https://cdn.jsdelivr.net/npm/d3@7.8.2/+esm";
globalThis.htmPreact = { html: htm.bind(Preact.h), ...Preact, ...Hooks };
globalThis.d3 = d3;
// ...
#2023-02-11
10:45:29
#2023-02-08
21:58:18