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

Fix sourcemap file size in report #1641

Merged
merged 3 commits into from
Jul 1, 2018
Merged

Conversation

DeMoorJasper
Copy link
Member

Fixes #1635

@@ -196,6 +196,8 @@ class Bundle {

await packager.end();

this.totalSize = packager.getSize();
Copy link
Member Author

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

Copy link
Member

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:

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.

Copy link
Member Author

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();
Copy link
Member

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:

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.

@devongovett devongovett merged commit 729f252 into master Jul 1, 2018
@devongovett devongovett deleted the fix/sourcemap-file-size branch July 1, 2018 19:21
2zH pushed a commit to 2zH/parcel that referenced this pull request Jul 11, 2018
devongovett pushed a commit that referenced this pull request Oct 15, 2018
devongovett pushed a commit that referenced this pull request Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants