Skip to content

Commit c60f44a

Browse files
committed
fix: docs build
1 parent de9393a commit c60f44a

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

packages/qwik-city/src/static/node/node-main.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type {
1010
import fs from 'node:fs';
1111
import { cpus as nodeCpus } from 'node:os';
1212
import { Worker } from 'node:worker_threads';
13-
import { dirname, extname, isAbsolute, join, resolve } from 'node:path';
13+
import { isAbsolute, resolve } from 'node:path';
1414
import { ensureDir } from './node-system';
1515
import { normalizePath } from '../../utils/fs';
1616

@@ -58,20 +58,9 @@ export async function createNodeMainProcess(sys: System, opts: StaticGenerateOpt
5858

5959
// Launch the worker using the package's index module, which bootstraps the worker thread.
6060
if (typeof __filename === 'string') {
61-
// CommonJS path
62-
const ext = extname(__filename) || '.js';
63-
workerFilePath = join(dirname(__filename), `index${ext}`);
61+
workerFilePath = __filename;
6462
} else {
65-
// ESM path (import.meta.url)
66-
const thisUrl = new URL(import.meta.url);
67-
const pathname = thisUrl.pathname || '';
68-
let ext = '.js';
69-
if (pathname.endsWith('.ts')) {
70-
ext = '.ts';
71-
} else if (pathname.endsWith('.mjs')) {
72-
ext = '.mjs';
73-
}
74-
workerFilePath = new URL(`./index${ext}`, thisUrl);
63+
workerFilePath = import.meta.url;
7564
}
7665

7766
if (typeof workerFilePath === 'string' && workerFilePath.startsWith('file://')) {

0 commit comments

Comments
 (0)