-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Update webpack notes to include mode option from webpack4 #850
base: main
Are you sure you want to change the base?
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Deploy preview for reactjs ready! Built with commit c0b499e |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Please split this into two sections: Webpack 3 and Earlier, and Webpack 4. |
@gaearon thanks for the suggestion. I have implemented it. Please review. |
@gaearon Please review. |
@@ -156,6 +156,19 @@ You can learn more about this in [webpack documentation](https://webpack.js.org/ | |||
|
|||
Remember that you only need to do this for production builds. You shouldn't apply `UglifyJsPlugin` or `DefinePlugin` with `'production'` value in development because they will hide useful React warnings, and make the builds much slower. | |||
|
|||
### webpack4 | |||
|
|||
In webpack4, instead of using `DefinePlugin`, `'production'` value can be set using `mode` option. It also provides `UglifyJsPlugin` by default in production mode. |
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.
Seems like the webpack section was updated and DefinePlugin
is not present in the documentation now.
https://reactjs.org/docs/optimizing-performance.html#webpack
Thanks for sending PR and sorry for the late turn around time :)
* docs(cn): fix a confusing statement The English version: For example, this code will not behave as you might expect because 0 will be printed when props.messages is an empty array: 呃,讲中文吧。 上一段示例在讲`{showHeader && <Header />}`,到这一段来个`仍然会被渲染`,还以为讲的是`MessageList`组件仍然会被渲染,容易理解错 * Update content/docs/jsx-in-depth.md Co-authored-by: QiChang Li <github@liqichang.com>
No description provided.