Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AjayPoshak
Copy link

No description provided.

@facebook-github-bot
Copy link
Collaborator

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!

@reactjs-bot
Copy link

reactjs-bot commented Apr 29, 2018

Deploy preview for reactjs ready!

Built with commit c0b499e

https://deploy-preview-850--reactjs.netlify.com

@facebook-github-bot
Copy link
Collaborator

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@gaearon
Copy link
Member

gaearon commented Apr 29, 2018

Please split this into two sections: Webpack 3 and Earlier, and Webpack 4.

@AjayPoshak
Copy link
Author

@gaearon thanks for the suggestion. I have implemented it. Please review.

@AjayPoshak
Copy link
Author

@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.
Copy link
Collaborator

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 :)

BetterZxx pushed a commit to BetterZxx/react.dev that referenced this pull request Mar 21, 2023
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants