File tree Expand file tree Collapse file tree 4 files changed +11
-6
lines changed
Expand file tree Collapse file tree 4 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -764,7 +764,9 @@ export function createStaticWorker(
764764 progress ?. clear ( )
765765 } ,
766766 forkOptions : {
767- env : { ...process . env , NODE_OPTIONS : formatNodeOptions ( nodeOptions ) } ,
767+ env : {
768+ NODE_OPTIONS : formatNodeOptions ( nodeOptions ) ,
769+ } ,
768770 } ,
769771 enableWorkerThreads : config . experimental . workerThreads ,
770772 exposedMethods : staticWorkerExposedMethods ,
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ async function turbopackBuildWithWorker() {
1616 maxRetries : 0 ,
1717 forkOptions : {
1818 env : {
19- ...process . env ,
2019 NEXT_PRIVATE_BUILD_WORKER : '1' ,
2120 NODE_OPTIONS : formatNodeOptions ( nodeOptions ) ,
2221 } ,
Original file line number Diff line number Diff line change @@ -57,7 +57,6 @@ async function webpackBuildWithWorker(
5757 maxRetries : 0 ,
5858 forkOptions : {
5959 env : {
60- ...process . env ,
6160 NEXT_PRIVATE_BUILD_WORKER : '1' ,
6261 NODE_OPTIONS : formatNodeOptions ( nodeOptions ) ,
6362 } ,
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import type { ChildProcess } from 'child_process'
22import { Worker as JestWorker } from 'next/dist/compiled/jest-worker'
33import { Transform } from 'stream'
44
5- type FarmOptions = ConstructorParameters < typeof JestWorker > [ 1 ]
5+ type FarmOptions = NonNullable < ConstructorParameters < typeof JestWorker > [ 1 ] >
66
77const RESTARTED = Symbol ( 'restarted' )
88
@@ -19,7 +19,12 @@ export class Worker {
1919
2020 constructor (
2121 workerPath : string ,
22- options : FarmOptions & {
22+ options : Omit < FarmOptions , 'forkOptions' > & {
23+ forkOptions ?:
24+ | ( Omit < NonNullable < FarmOptions [ 'forkOptions' ] > , 'env' > & {
25+ env ?: Partial < NodeJS . ProcessEnv > | undefined
26+ } )
27+ | undefined
2328 timeout ?: number
2429 onActivity ?: ( ) => void
2530 onActivityAbort ?: ( ) => void
@@ -48,8 +53,8 @@ export class Worker {
4853 forkOptions : {
4954 ...farmOptions . forkOptions ,
5055 env : {
51- ...( ( farmOptions . forkOptions ?. env || { } ) as any ) ,
5256 ...process . env ,
57+ ...( ( farmOptions . forkOptions ?. env || { } ) as any ) ,
5358 IS_NEXT_WORKER : 'true' ,
5459 } as any ,
5560 } ,
You can’t perform that action at this time.
0 commit comments