-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix sourcemap file size in report #1641
Conversation
@@ -196,6 +196,8 @@ class Bundle { | |||
|
|||
await packager.end(); | |||
|
|||
this.totalSize = packager.getSize(); |
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.
This line updates bundle.totalSize
to the actual final amount of written bytes instead of relying on addAsset
to be called for every packager
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 think we will need to adjust the packager for tree shaking here or we'll get incorrect sizes:
parcel/src/packagers/JSConcatPackager.js
Line 508 in 3a8f38c
this.bundle.totalSize = output.length; |
Can you change that to this.size = output.length
? That way when we call getSize
here after the bundle has finished we'll get the correct size.
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.
Fixed it in the latest commit
@@ -196,6 +196,8 @@ class Bundle { | |||
|
|||
await packager.end(); | |||
|
|||
this.totalSize = packager.getSize(); |
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 think we will need to adjust the packager for tree shaking here or we'll get incorrect sizes:
parcel/src/packagers/JSConcatPackager.js
Line 508 in 3a8f38c
this.bundle.totalSize = output.length; |
Can you change that to this.size = output.length
? That way when we call getSize
here after the bundle has finished we'll get the correct size.
Fixes #1635