@@ -277,7 +277,16 @@ module.exports = {
277277 use : [
278278 // This loader parallelizes code compilation, it is optional but
279279 // improves compile time on larger projects
280- require . resolve ( 'thread-loader' ) ,
280+ {
281+ loader : require . resolve ( 'thread-loader' ) ,
282+ options : {
283+ // Forwards the process args (such as --require) to the child
284+ // workers. Ensures that the worker operates in the same kind
285+ // of environment than the current one (important in case a
286+ // preloaded script modifies the env)
287+ workerNodeArgs : process . execArgv ,
288+ } ,
289+ } ,
281290 {
282291 // We need to use our own loader until `babel-loader` supports
283292 // customization
@@ -332,7 +341,16 @@ module.exports = {
332341 use : [
333342 // This loader parallelizes code compilation, it is optional but
334343 // improves compile time on larger projects
335- require . resolve ( 'thread-loader' ) ,
344+ {
345+ loader : require . resolve ( 'thread-loader' ) ,
346+ options : {
347+ // Forwards the process args (such as --require) to the child
348+ // workers. Ensures that the worker operates in the same kind
349+ // of environment than the current one (important in case a
350+ // preloaded script modifies the env)
351+ workerNodeArgs : process . execArgv ,
352+ } ,
353+ } ,
336354 {
337355 loader : require . resolve ( 'babel-loader' ) ,
338356 options : {
0 commit comments