-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Description
What happened?
Looking at both my output files compiled through vite using cesiumjs as a dependency, as well as the pre-compiled file (node_modules/cesium/Build/Cesium/Cesium.js), I see they contain a huge amount of comments. vite does not remove them since they are found in pre-embedded strings.
For example:
// To deal with smaller values of PRIMARY_STEPS (e.g. 4)
// we implement a split strategy: sky or horizon.
// For performance reasons, instead of a if/else branch
// a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0
float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);
// Value close to 0.0: close to the horizon
// Value close to 1.0: above in the sky
float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x));
This increases the output file size, which is really important when downloading over the net. Would it be possible to strip those comments?
Reproduction steps
- Open node_modules/cesium/Build/Cesium/Cesium.js
- Look for /*, /*! or //
Sandcastle example
No response
Environment
Browser: n/a
CesiumJS Version: 1.136
Operating System: n/a
Reactions are currently unavailable