Commit 97c7131d authored by Maël Nison's avatar Maël Nison Committed by Dan Abramov
Browse files

Forwards args through thread-loader (#5157)

* Forwards args through thread-loader

* Comments & dev
parent 72fe2df6
Showing with 30 additions and 2 deletions
+30 -2
...@@ -225,6 +225,11 @@ module.exports = { ...@@ -225,6 +225,11 @@ module.exports = {
loader: require.resolve('thread-loader'), loader: require.resolve('thread-loader'),
options: { options: {
poolTimeout: Infinity, // keep workers alive for more effective watch mode poolTimeout: Infinity, // keep workers alive for more effective watch mode
// Forwards the process args (such as --require) to the child
// workers. Ensures that the worker operates in the same kind
// of environment than the current one (important in case a
// preloaded script modifies the env)
workerNodeArgs: process.execArgv,
}, },
}, },
{ {
...@@ -284,6 +289,11 @@ module.exports = { ...@@ -284,6 +289,11 @@ module.exports = {
loader: require.resolve('thread-loader'), loader: require.resolve('thread-loader'),
options: { options: {
poolTimeout: Infinity, // keep workers alive for more effective watch mode poolTimeout: Infinity, // keep workers alive for more effective watch mode
// Forwards the process args (such as --require) to the child
// workers. Ensures that the worker operates in the same kind
// of environment than the current one (important in case a
// preloaded script modifies the env)
workerNodeArgs: process.execArgv,
}, },
}, },
{ {
......
...@@ -277,7 +277,16 @@ module.exports = { ...@@ -277,7 +277,16 @@ module.exports = {
use: [ use: [
// This loader parallelizes code compilation, it is optional but // This loader parallelizes code compilation, it is optional but
// improves compile time on larger projects // improves compile time on larger projects
require.resolve('thread-loader'), {
loader: require.resolve('thread-loader'),
options: {
// Forwards the process args (such as --require) to the child
// workers. Ensures that the worker operates in the same kind
// of environment than the current one (important in case a
// preloaded script modifies the env)
workerNodeArgs: process.execArgv,
},
},
{ {
// We need to use our own loader until `babel-loader` supports // We need to use our own loader until `babel-loader` supports
// customization // customization
...@@ -332,7 +341,16 @@ module.exports = { ...@@ -332,7 +341,16 @@ module.exports = {
use: [ use: [
// This loader parallelizes code compilation, it is optional but // This loader parallelizes code compilation, it is optional but
// improves compile time on larger projects // improves compile time on larger projects
require.resolve('thread-loader'), {
loader: require.resolve('thread-loader'),
options: {
// Forwards the process args (such as --require) to the child
// workers. Ensures that the worker operates in the same kind
// of environment than the current one (important in case a
// preloaded script modifies the env)
workerNodeArgs: process.execArgv,
},
},
{ {
loader: require.resolve('babel-loader'), loader: require.resolve('babel-loader'),
options: { options: {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment