Small refactor

This commit is contained in:
Jade Ellis 2024-06-26 22:07:21 +01:00
parent 86883fcf71
commit 27fc6a766e
No known key found for this signature in database
GPG key ID: 8705A2A3EBF77BD2

View file

@ -13,7 +13,7 @@ export function init() {
[file: string]: string;
}, options?: MinifyOptions): Promise<MinifyOutput> {
if (!!window.SharedWorker) {
if (is_browser && !!window.SharedWorker) {
if (!worker) {
worker = new SharedWorker(new URL('./terserWorker.ts', import.meta.url), { type: "module" })
worker.port.onmessage = (e: MessageEvent<any>) => {