|
7 | 7 | */
|
8 | 8 |
|
9 | 9 | import { readFile } from 'node:fs/promises';
|
10 |
| -import { extname, join, posix } from 'node:path'; |
11 |
| -import { pathToFileURL } from 'node:url'; |
| 10 | +import { extname, posix } from 'node:path'; |
12 | 11 | import { NormalizedApplicationBuildOptions } from '../../builders/application/options';
|
13 | 12 | import { OutputMode } from '../../builders/application/schema';
|
14 | 13 | import { BuildOutputFile, BuildOutputFileType } from '../../tools/esbuild/bundler-context';
|
15 | 14 | import { BuildOutputAsset } from '../../tools/esbuild/bundler-execution-result';
|
16 | 15 | import { assertIsError } from '../error';
|
17 | 16 | import { urlJoin } from '../url';
|
18 | 17 | import { WorkerPool } from '../worker-pool';
|
| 18 | +import { IMPORT_EXEC_ARGV } from './esm-in-memory-loader/utils'; |
19 | 19 | import {
|
20 | 20 | RouteRenderMode,
|
21 | 21 | RoutersExtractorWorkerResult,
|
@@ -194,12 +194,7 @@ async function renderPages(
|
194 | 194 | }> {
|
195 | 195 | const output: PrerenderOutput = {};
|
196 | 196 | const errors: string[] = [];
|
197 |
| - |
198 |
| - const workerExecArgv = [ |
199 |
| - '--import', |
200 |
| - // Loader cannot be an absolute path on Windows. |
201 |
| - pathToFileURL(join(__dirname, 'esm-in-memory-loader/register-hooks.js')).href, |
202 |
| - ]; |
| 197 | + const workerExecArgv = [IMPORT_EXEC_ARGV]; |
203 | 198 |
|
204 | 199 | if (sourcemap) {
|
205 | 200 | workerExecArgv.push('--enable-source-maps');
|
@@ -301,11 +296,7 @@ async function getAllRoutes(
|
301 | 296 | return { errors: [], serializedRouteTree: routes };
|
302 | 297 | }
|
303 | 298 |
|
304 |
| - const workerExecArgv = [ |
305 |
| - '--import', |
306 |
| - // Loader cannot be an absolute path on Windows. |
307 |
| - pathToFileURL(join(__dirname, 'esm-in-memory-loader/register-hooks.js')).href, |
308 |
| - ]; |
| 299 | + const workerExecArgv = [IMPORT_EXEC_ARGV]; |
309 | 300 |
|
310 | 301 | if (sourcemap) {
|
311 | 302 | workerExecArgv.push('--enable-source-maps');
|
|
0 commit comments