Kitware / candela

Visualization components for the web
https://candela.readthedocs.io
Apache License 2.0
116 stars 29 forks source link

Minify in production #548

Closed waxlamp closed 6 years ago

waxlamp commented 6 years ago

This PR fixes a long-standing issue in which non-production versions of Candela were being published to NPM. This adds a build:prod script to each package's package.json file which simply invokes Webpack in production mode. This has two major benefits:

  1. Drastically reduced bundle sizes. For instance, the candela-all package goes from 11MB to 2MB
  2. Better performance. This is due to the fact that the development bundles contain code wrapped in calls to eval() in order to enable source maps etc.

This needed to be fixed in any case, but I am doing it now in order to fix a bug in the testing process for Girder's Candela plugin.