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
Why the production bundle size is significantly larger that create-react-app #2909
Comments
Tree shaking (
export var Fa500px = function (props) {
return /*...*/;
};
Fa500px.displayName = "Fa500px"; // <--------------------
Discussion regarding bundle size in react-icons: https://github.com/react-icons/react-icons/issues/154 |
Thanks @mischnic for the quick response however I am getting
I am using version 1.12.3. Please advise. |
Ok I found out the option is actually |
Sorry, I always mix up these terms. |
No worries, thanks for helping out. |
I'm keeping this open because export var Fa500px = function (props) {
return /*...*/;
};
Fa500px.displayName = "Fa500px"; is probably a common pattern and should be supported (at least this simple case). |
That would be great. I am struggling with this particular |
Should be fixed by #2979. |
Thanks @devongovett for making the changes. When will this update become available? At the moment the version of parcel-bundler stays at 1.12.3. |
* WIP: v2 scope hoisting * Support sideEffects flag * Don't edit parcel 1 * Fix flow errors * Type safe traversal filtering * Run tests faster * Base child assets on the same id base as parents * Fix flow errors * Only enable scope hoisting in production mode by default * Fix lint * Clean up * Shake exports with pure property assignments (#2909) * Send BundleGraph to packagers * Lint * Fix flow * Clear scope cache before crawling * Fix shake * Define __esModule interop flag when requiring ES module from CommonJS * Replace module.require in scope hoisting * Fix assigning to exports from inside a function in scope hoisting * Format
@devongovett Has parcel been tested out for tree-shaking react-icons? I just tried to update parcel to the latest version and the problem still persists. |
@JulienDemarque I just tested this with the current Parcel 2 build and doing |
I did a very simple experiment with the following settings
index.html (used for
parcel-bundler
only ascreate-react-app
creates one automatically)index.js (also used in the project initialized with
create-react-app
)./node_modules/.bin/parcel --version
1.12.3
./node_modules/.bin/parcel build index.html
While in a separate project initialized with create-react-app (2.1.8), the bundle size is way much smaller
Without gzip:
Nodejs version: 8.14.1
OS: Mac OSX Mojave
Can someone tell me why the bundle size difference is so significant? Are there any options I can use to improve/reduce the bundle size using parcel?
The text was updated successfully, but these errors were encountered: