You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fet(build): Create debug versions of minified bundles (#4699)
This adds to our base CDN rollup config the ability to create bundles which are minified but nonetheless contain debug logging.
Notable changes:
- Setting the constant (`__SENTRY_DEBUG__`) which controls whether or not to include logging is now done by a separate rollup plugin rather than by terser (which was setting the now-obsolete `__SENTRY_NO_DEBUG__` flag). This allows rollup to do the treeshaking, which is good because it lets us create a _non_-minified no-debug bundle. Though such a bundle doesn't make a lot of sense to publish (why strip the logging if you’re not also going to minify the code?), it _is_ very helpful for us, because it allows us to see what's being treeshaken in the context of human-readable code.
- The scope of the helper function `makeMinificationVariants` has broadened to include the creation of all bundle variants*. As a result, it no longer takes an array of configs (which it might have gotten had there ever been a `makeJSVersionVariants` or `makeDebugVariants` whose results could have been passed to `makeMinificationVariants`) but instead takes a single base config which it then spins out into all necessary flavors. This broadening of scope is also now reflected in variable names and the function name itself.
* This is not quite true, in that it's still not handling the ES5/ES6 question. I chose not to incorporate that because as soon as we go ES6-only in v7, it will no longer be an issue for any package except perhaps the browser package.
0 commit comments