-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
modify WEBPACKER PARALLEL environment variable. #2850
Conversation
@@ -37,11 +38,24 @@ const canProcess = (rule, fn) => { | |||
return null | |||
} | |||
|
|||
const asBoolean = (str) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @masato-hi Could you please use the above function isBoolean
(line 2)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for review.
The isBoolean
function cannot handle "false"
correctly
Hey, @masato-hi ! 👋 Thanks for your contribution! For this purpose (modify WEBPACKER_PARALLEL environment variable for a specific environment, for example), this works for your scenario?
process.env.WEBPACKER_PARALLEL = 'desired-value'
// ... existing code of file ... Or this not works for you, and the PR in this case solves some problem related to it? Let me know what you think about 🤝 🍻 |
…le from the command line.
549ec62
to
7ec0be8
Compare
@pedrofurtado Thanks for confirming. It looks like it's working fine in my environment. 🤔 (The
Output:
The value of "parallel" is 2. The configuration only affects production builds. |
@gauravtiwari |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some inline suggestions, hope this helps.
Check the link for details. | ||
|
||
https://webpack.js.org/plugins/terser-webpack-plugin/#parallel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the link for details. | |
https://webpack.js.org/plugins/terser-webpack-plugin/#parallel | |
[`terser-webpack-plugin` documentation](https://webpack.js.org/plugins/terser-webpack-plugin/) has more details. |
@@ -111,6 +111,19 @@ mv $HOME/your_rails_app/node_modules/.bin/elm-make $HOME/your_rails_app/node_mod | |||
printf "#\041/bin/bash\n\necho \"Running elm-make with sysconfcpus -n 2\"\n\n$HOME/dependencies/sysconfcpus/bin/sysconfcpus -n 2 $HOME/your_rails_app/node_modules/.bin/elm-make-old \"\$@\"" > $HOME/your_rails_app/node_modules/.bin/elm-make | |||
chmod +x $HOME/your_rails_app/node_modules/.bin/elm-make | |||
``` | |||
## If an error occurs or times out during a production build on Continuous Integration (CI) services such as CircleCI, CodeShip, Travis CI | |||
|
|||
The parallel option of Tersor-Plugin is enabled in the production build, which may cause memory shortage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parallel option of Tersor-Plugin is enabled in the production build, which may cause memory shortage. | |
The parallel option of TerserWebpackPlugin is enabled in the production build, which may cause memory shortage. |
@@ -111,6 +111,19 @@ mv $HOME/your_rails_app/node_modules/.bin/elm-make $HOME/your_rails_app/node_mod | |||
printf "#\041/bin/bash\n\necho \"Running elm-make with sysconfcpus -n 2\"\n\n$HOME/dependencies/sysconfcpus/bin/sysconfcpus -n 2 $HOME/your_rails_app/node_modules/.bin/elm-make-old \"\$@\"" > $HOME/your_rails_app/node_modules/.bin/elm-make | |||
chmod +x $HOME/your_rails_app/node_modules/.bin/elm-make | |||
``` | |||
## If an error occurs or times out during a production build on Continuous Integration (CI) services such as CircleCI, CodeShip, Travis CI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## If an error occurs or times out during a production build on Continuous Integration (CI) services such as CircleCI, CodeShip, Travis CI | |
## If an error occurs or times out during a production build |
@guillaumebriday, For sure, we should do something with PR. Running out of memory causes a very confusing build just seems to hang when it's swapping memory. I don't like the current default:
Defaults should be defaults, which is How about this:
https://webpack.js.org/plugins/terser-webpack-plugin/#parallel
|
Feel free to reopen this PR here: |
Will be possible to specify the WEBPACKER PARALLEL environment variable from the command line.
We also added a document about WEBPACKER_PARALLEL.
The master branch is currently working on 6.x, so we need to merge after merging this pull request.
#2839
I'm not good at English, so I'm looking for opinions on better documentation.
ref: #2093