Skip to content

Compiled files include comments #13089

@jmgomezpoveda

Description

@jmgomezpoveda

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

  1. Open node_modules/cesium/Build/Cesium/Cesium.js
  2. Look for /*, /*! or //

Sandcastle example

No response

Environment

Browser: n/a
CesiumJS Version: 1.136
Operating System: n/a

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions