MII
MII

Reputation: 969

Does Webpack tree-shake by default when building production React project?

I'm learning React and want to know if Webpack tree-shakes a React project by default when we do npm run build to create the production version of the project?

Upvotes: 1

Views: 111

Answers (1)

Jonathan Irwin
Jonathan Irwin

Reputation: 5747

Yes it does. You can view the built application in the build/ folder.

If you look at some of those .js files you will see they look quite different from your source contents. Your source will be tree-shaken and minified.

Upvotes: 2

Related Questions