From 59d5331b6895dce2cdf9cf260322989bd967f658 Mon Sep 17 00:00:00 2001 From: modeco80 Date: Tue, 23 Apr 2024 10:42:36 -0400 Subject: [PATCH] replace dirname with a hack that should behave like before the '@ts-expect-error' is to silence tsc just in case, since this function does in fact exist during bundling. techinically the real solution would be to declare it but /shrug --- cvmts/src/WSServer.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cvmts/src/WSServer.ts b/cvmts/src/WSServer.ts index 2c54010..101d454 100644 --- a/cvmts/src/WSServer.ts +++ b/cvmts/src/WSServer.ts @@ -21,8 +21,12 @@ import { Size, Rect, Logger } from '@cvmts/shared'; import jpegTurbo from "@computernewb/jpeg-turbo"; import sharp from 'sharp'; -// probably better -const __dirname = process.cwd(); +// @ts-expect-error (I know, but this is already ugly) +// really wish I didn't have to do it like this.. +const __dirname = fileURLToPath(new __parcel__URL__('..')); + + +console.log(__dirname); // ejla this exist. Useing it. type ChatHistory = {