Comments (7)
Actually, sourcemap: true
correctly computes renderedLength
, but later it's dismissed in ModuleLengths
.
This computation can be better adjusted for unicode by this change in getBytesPerFileUsingSourceMap
:
- modules[id].renderedLength += 1;
+ modules[id].renderedLength += Buffer.byteLength(code[i], "utf-8");`
Ran additional tests on date-fns/locale
(a lot of unicode), here are the results:
- Actual bundle size: 597kB
- Reported: 990kB (166% actual), regardless of
sourcemap
option. - Reported using rollup's
renderedLength
andsourcemap: false
: 915kB (153% actual) - Reported using
renderedLength
from currentsourcemap: true
: 521kB (87% actual) - Reported using
renderedLength
with unicode-adjustedsourcemap
: 597kB (matches actual)
How would you feel about using renderedLength
when sourcemap
option is enabled, and adding unicode adjustment I propose?
from rollup-plugin-visualizer.
Hi. First of all Thanks for every detailed issue.
Yes reportered size always different from actual one. Closest you can get to reality with sourcemap option set to true.
I should say i never tried to use non ascii chracters.
It would be nice if you will make PR and i will take a look. Otherwise no ETA.
Also i am curious if we should use codePointAt or anything that correctly traverse code points. Random index could point in the middle of surrogate pair
from rollup-plugin-visualizer.
I have published 5.9.2. Take a look pls if it improves size reporting with sourcemap.
from rollup-plugin-visualizer.
I have published 5.9.2. Take a look pls if it improves size reporting with sourcemap.
Heads up, 5.9.2 seems to be missing from the changelog
from rollup-plugin-visualizer.
I have published 5.9.2. Take a look pls if it improves size reporting with sourcemap.
I think it was supposed to say 5.9.1
since that was published 4 days ago and sounds like it matches this issue.
from rollup-plugin-visualizer.
I think it was supposed to say
5.9.1
since that was published 4 days ago and sounds like it matches this issue.
Except there was a 5.9.2 published
from rollup-plugin-visualizer.
The difference between 5.9.2 and 5.9.1 is that i dropped 14.x from test matrix
from rollup-plugin-visualizer.
Related Issues (20)
- A third-party library appears on the chunk that has nothing to do with him. Is this bug?
- Exclude is not working with Vite HOT 1
- Open flag option does not work in CLI? HOT 3
- Typings error HOT 1
- No stats for CSS files in the build output HOT 2
- Tooltips are often unhelpful because of size or placement HOT 3
- No affordances for what can be clicked HOT 2
- renderedLength from sourcemaps is ignored, pre-plugins module sizes are used instead HOT 2
- Rollup 4.x HOT 5
- Compare with list of chunks HOT 1
- TypeScript issue with Rollup 4 and Vite 5 HOT 1
- Make output idempotent HOT 2
- Add flamechart HOT 2
- Display `imported by` field in treemap view for modules HOT 6
- ✕ unmet peer rollup@^2.56.3: found 3.29.4 HOT 1
- Check module ids with pnpm HOT 1
- Aggregated tooltip visual issue
- [Feature Request] We can drag the element in network
- 5.11.0 new strict mode not allowing files in CLI command HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rollup-plugin-visualizer.