-
Notifications
You must be signed in to change notification settings - Fork 7
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
File sizes appear larger in visualizer than in reality #8
Comments
It seems like only happen in vitesse or |
v0.10.0 involves |
The sourcemap option is indeed less detailed, and also not more accurate, in my experience. E.g. I separated out a lodash chunk to test it, and the build (and file system) show that chunk as 34.18 kB, whereas the sourcemap options shows it as 185.66 KB (which is 190.12 kB), so it's off by 5.5x. Another chunk, however measured 2.2x off. This hurts the functional usefulness of the tool dramatically because the relative sizes of modules and chunks are not accurate. It wouldn't be such an issue if just the numbers were inaccurate, but with the relative sizing being so dramatically off, this tool is really only useful as a module graph. Without the sourcemap option, the numbers appear identical, but there is gzip info at least. Edit: Appears to match this issue. Since it's downstream, and I don't see anything wrong with this Vite wrapper code, there's probably not much the author can do. This plugin is already using the latest, and it doesn't appear to help. |
Yeah, it seems the output bundles information of Vite(internal is rollup) is inaccurate, you only can get accurate final size of a module bundle, which are tree-shaken results, but only get size of a module before tree-shaken in module graph. Result in inaccurate in some cases. |
@KusStar seems like this issue was fixed in rollup-plugin-visualizer, would you mind updating your package to the latest version? |
Oh sorry, just saw that you are already on this version :( |
Any workarounds for this issue? I'm seeing the same issue. When I visualize deps, it seems like it's not honoring |
Are there any updates? It's too hard to analyze deps if I can't trust the data ( |
I've just noticed this problem too. It's not very useful if the sizes are all off. |
Why: - The files sizes reported by the tool appear many times larger than they should. The reported file sizes seem to be before tree-shaking. Adding the --sourcemap option makes them slightly more accurate. KusStar/vite-bundle-visualizer#8
Why: - The files sizes reported by the tool appear many times larger than they should. The reported file sizes seem to be before tree-shaking. Adding the --sourcemap option makes them slightly more accurate. KusStar/vite-bundle-visualizer#8
Same issue here. Seems like the problem is within the underlying rollup-plugin-visualizer package. Probably nothing that can be done to fix it in vite-bundle-visualizer. Thank you! 🍻 |
The file sizes shown in the visualizer are larger than the ones reported by Vite on the command line or that show up on disk after building. To see this, you can just clone vitesse, install its packages, and run vite-bundle-visualizer for it.
On the command line, a file size of 153kb is shown for the main javascript asset:
Similarly, on disk, the file appears to be 150kb:
But in the visualizer, the same file (with the same hash in the name, so it should have the same contents) is reported to be 461kb:
The text was updated successfully, but these errors were encountered: