From 732b4bafd1d020361f2e9e64814c210b34d2c790 Mon Sep 17 00:00:00 2001 From: Jeremy Scheff Date: Thu, 30 Jan 2025 23:07:59 -0500 Subject: [PATCH] Cleanup --- tools/watch/watchCss.ts | 5 +---- tools/watch/watchJs.ts | 12 ++++-------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/tools/watch/watchCss.ts b/tools/watch/watchCss.ts index 6c3d2b395..a43676e6e 100644 --- a/tools/watch/watchCss.ts +++ b/tools/watch/watchCss.ts @@ -1,4 +1,3 @@ -import path from "node:path"; import { Worker } from "node:worker_threads"; // This import is needed for https://github.com/parcel-bundler/lightningcss/issues/892 @@ -9,9 +8,7 @@ export const watchCss = async ( updateEnd: (filename: string) => void, updateError: (filename: string, error: Error) => void, ) => { - const worker = new Worker( - path.join(import.meta.dirname, "watchCssWorker.ts"), - ); + const worker = new Worker(new URL("watchCssWorker.ts", import.meta.url)); worker.on("message", (message) => { if (message.type === "start") { diff --git a/tools/watch/watchJs.ts b/tools/watch/watchJs.ts index e4b721bcd..ed5de8351 100644 --- a/tools/watch/watchJs.ts +++ b/tools/watch/watchJs.ts @@ -1,4 +1,3 @@ -import path from "node:path"; import { Worker } from "node:worker_threads"; export const watchJs = ( @@ -9,14 +8,11 @@ export const watchJs = ( for (const name of ["ui", "worker"]) { const filename = `build/gen/${name}.js`; - const worker = new Worker( - path.join(import.meta.dirname, "watchJsWorker.ts"), - { - workerData: { - name, - }, + const worker = new Worker(new URL("watchJsWorker.ts", import.meta.url), { + workerData: { + name, }, - ); + }); worker.on("message", (message) => { if (message.type === "start") {