@@ -277,7 +277,16 @@ module.exports = {
277
277
use : [
278
278
// This loader parallelizes code compilation, it is optional but
279
279
// 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
+ } ,
281
290
{
282
291
// We need to use our own loader until `babel-loader` supports
283
292
// customization
@@ -332,7 +341,16 @@ module.exports = {
332
341
use : [
333
342
// This loader parallelizes code compilation, it is optional but
334
343
// 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
+ } ,
336
354
{
337
355
loader : require . resolve ( 'babel-loader' ) ,
338
356
options : {
0 commit comments