about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2023-09-13 10:19:40 +0200
committerAlan Pearce2023-09-13 10:19:40 +0200
commit93197c349e19f1e5b1cb5244827eab64aa4ebba4 (patch)
tree241b0e10a184adf8a69ced8db1f21daaef333b2e
parentc738123d55b8c9418a76afcbfd4480cc90de0e94 (diff)
downloadhomestead-93197c349e19f1e5b1cb5244827eab64aa4ebba4.tar.lz
homestead-93197c349e19f1e5b1cb5244827eab64aa4ebba4.tar.zst
homestead-93197c349e19f1e5b1cb5244827eab64aa4ebba4.zip
Remove defunct live-reload
Doesn't work when serving static files
-rwxr-xr-xbun.lockbbin2002 -> 1630 bytes
-rw-r--r--package.json1
-rw-r--r--src/index.ts7
3 files changed, 3 insertions, 5 deletions
diff --git a/bun.lockb b/bun.lockb
index 5af2fa2..9d90bd9 100755
--- a/bun.lockb
+++ b/bun.lockb
Binary files differdiff --git a/package.json b/package.json
index 314e9f9..354305b 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,6 @@
   "name": "homestead",
   "module": "src/index.ts",
   "devDependencies": {
-    "bun-html-live-reload": "^0.1.1",
     "bun-types": "latest"
   },
   "peerDependencies": {
diff --git a/src/index.ts b/src/index.ts
index 4382aa4..69c9b1a 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,8 +1,7 @@
 import path from "node:path";
 import fs, { Stats } from "node:fs";
 import fsp from "node:fs/promises";
-import { withHtmlLiveReload } from "bun-html-live-reload";
-import type { BunFile } from "bun-types";
+import type { BunFile, Serve } from "bun";
 
 import readConfig from "./config";
 
@@ -104,7 +103,7 @@ function parseIfModifiedSinceHeader(header: string | null): number {
   return header ? new Date(header).getTime() + 999 : 0;
 }
 
-export default withHtmlLiveReload({
+export default {
   fetch: async function (request) {
     const pathname = new URL(request.url).pathname;
     const file = files.get(pathname);
@@ -147,4 +146,4 @@ export default withHtmlLiveReload({
     }
     return serveFile(file);
   },
-});
+} satisfies Serve;