Skip to content

Commit aba9542

Browse files
authored
Revert "Fix dev server build concurrency and type resolution (#42)" (#44)
This reverts commit 6c2e2c2.
1 parent 52d2be9 commit aba9542

2 files changed

Lines changed: 7 additions & 13 deletions

File tree

src/dev/dev-server2.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import http from "node:http"
66
import path from "node:path"
77
import fs from "node:fs/promises"
88
import { isGitIgnored } from "globby"
9-
import { Mutex } from "async-mutex"
109
import { getTempPathInApp } from "src/bundle/get-temp-path-in-app.js"
1110
import { constructManifest } from "src/bundle/construct-manifest.js"
1211
import { formatMessages } from "esbuild"
@@ -53,8 +52,6 @@ export const startDevServer2 = async (options: StartDevServerOptions) => {
5352
await fs.writeFile(manifestPath, manifestContent, "utf-8")
5453
}
5554

56-
const buildMutex = new Mutex()
57-
5855
const build = async () => {
5956
options.onBuildStart?.()
6057
const buildStartedAt = performance.now()
@@ -212,12 +209,10 @@ export const startDevServer2 = async (options: StartDevServerOptions) => {
212209
})
213210

214211
const handleFileChange = async (isManifestChange: boolean = false) => {
215-
await buildMutex.runExclusive(async () => {
216-
if (isManifestChange) {
217-
await updateManifest()
218-
}
219-
await build()
220-
})
212+
if (isManifestChange) {
213+
await updateManifest()
214+
}
215+
await build()
221216
}
222217

223218
watcher.on("change", async (file) => {
@@ -236,7 +231,8 @@ export const startDevServer2 = async (options: StartDevServerOptions) => {
236231

237232
// Initial build is triggered by watcher's ignoreInitial: false
238233
// If ignoreInitial were true, you'd call:
239-
await handleFileChange(true)
234+
await updateManifest()
235+
await build()
240236

241237
const stop = async () => {
242238
watcher.close()

tsconfig.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
"strict": true /* Enable all strict type-checking options. */,
1010
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
1111
"paths": {
12-
"src/*": ["./src/*"],
13-
"winterspec": ["./src/index.ts"],
14-
"winterspec/*": ["./src/*"]
12+
"src/*": ["./src/*"]
1513
},
1614
"resolveJsonModule": true,
1715
"rootDir": "./"

0 commit comments

Comments
 (0)