liveReload を true にすると、Worker スクリプトが変わったときに Miniflare がブラウザーを自動で更新します。
const mf = new Miniflare({
liveReload: true,
});Miniflare は、Content-Type ヘッダーが text/html のレスポンスの末尾にだけ、ライブリロードに必要な <script> タグを挿入します。
export default {
fetch() {
const body = `
<!DOCTYPE html>
<html>
<body>
<p>Try update me!</p>
</body>
</html>
`;
return new Response(body, {
headers: { "Content-Type": "text/html; charset=utf-8" },
});
},
};