Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fix live reload #165

Merged
merged 3 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions build/esbuild-server.ts

This file was deleted.

11 changes: 11 additions & 0 deletions build/esbuild-watch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import esbuild from "esbuild";
import { esBuildContext } from "./esbuild-build";

async function watch() {
const ctx = await esbuild.context(esBuildContext);
await ctx.watch();
console.log("Watching...");
}

// This MUST NOT be awaited.
void watch();
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
"node": ">=20.10.0"
},
"scripts": {
"start": "wrangler pages dev --port 8080",
"watch": "tsx build/esbuild-server.ts",
"start": "run-p start-wrangler watch",
"start-wrangler": "npx wrangler pages dev static --port 8080",
"watch": "tsx build/esbuild-watch.ts",
"build": "tsx build/esbuild-build.ts",
"format": "run-s format:lint format:prettier format:cspell",
"format:lint": "eslint --fix .",
Expand Down
Loading
Loading