diff --git a/src/dev/dev-server2.ts b/src/dev/dev-server2.ts index a81d67e..acdeb55 100644 --- a/src/dev/dev-server2.ts +++ b/src/dev/dev-server2.ts @@ -6,7 +6,6 @@ import http from "node:http" import path from "node:path" import fs from "node:fs/promises" import { isGitIgnored } from "globby" -import { Mutex } from "async-mutex" import { getTempPathInApp } from "src/bundle/get-temp-path-in-app.js" import { constructManifest } from "src/bundle/construct-manifest.js" import { formatMessages } from "esbuild" @@ -53,8 +52,6 @@ export const startDevServer2 = async (options: StartDevServerOptions) => { await fs.writeFile(manifestPath, manifestContent, "utf-8") } - const buildMutex = new Mutex() - const build = async () => { options.onBuildStart?.() const buildStartedAt = performance.now() @@ -212,12 +209,10 @@ export const startDevServer2 = async (options: StartDevServerOptions) => { }) const handleFileChange = async (isManifestChange: boolean = false) => { - await buildMutex.runExclusive(async () => { - if (isManifestChange) { - await updateManifest() - } - await build() - }) + if (isManifestChange) { + await updateManifest() + } + await build() } watcher.on("change", async (file) => { @@ -236,7 +231,8 @@ export const startDevServer2 = async (options: StartDevServerOptions) => { // Initial build is triggered by watcher's ignoreInitial: false // If ignoreInitial were true, you'd call: - await handleFileChange(true) + await updateManifest() + await build() const stop = async () => { watcher.close() diff --git a/tsconfig.json b/tsconfig.json index bfa05ef..9458185 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,9 +9,7 @@ "strict": true /* Enable all strict type-checking options. */, "skipLibCheck": true /* Skip type checking all .d.ts files. */, "paths": { - "src/*": ["./src/*"], - "winterspec": ["./src/index.ts"], - "winterspec/*": ["./src/*"] + "src/*": ["./src/*"] }, "resolveJsonModule": true, "rootDir": "./"