butternut icon indicating copy to clipboard operation
butternut copied to clipboard

The fast, future-friendly minifier

Results 66 butternut issues
Sort by recently updated
recently updated
newest added

Via https://github.com/Rich-Harris/butternut/issues/118#issuecomment-302134938 — good list of things to test in https://api.cdnjs.com/libraries

I tried to squash [es6-shim](https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.3/es6-shim.min.js), which among other things provides a polyfill for `String.prototype.startsWith`. There seem to be [intentional misbehaviours](https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L865-L868) in the source code, which lets Butternut fail its job....

bug

I've encountered errors in multiple instances where acorn was complaining about certain structures like `with` blocks or deleting variables "in strict mode". The point is that the source files handled...

**Input:** ` if(x)if(y){} ` **Output Butternut:** ` x&&() ` **Output UglifyJS:** ` if(x)if(y){} `

bug

I tried to squash [analytics.js](https://cdnjs.cloudflare.com/ajax/libs/analytics.js/2.9.1/analytics.min.js) in the Butternut JavaScript API. The code contains `eval` calls, but since I have `allowDangerousEval` set to `true`, this should not be an issue for...

I'm curious whether it would make sense to introduce some kind of deoptimization guard, which does not apply the optimization (or maybe throws an error to tell that something is...

bug

[Repro](https://butternut.now.sh/?version=0.4.4&gist=cf99651d4761f7ece4e0e29067a3df59)

better minification

I was wondering how `uglify-es` was able to compete with Butternut by only mangling variable names. For example, Preact: | | minified | zipped | time | |-------------------------|----------|----------|----------| | butternut...

better minification

This already happens in simple cases: ```js // input function foo () { console.log(1); return; console.log(2); } // output function foo(){console.log(1)} ``` But it fails if there's a declaration after...

better minification

More advanced version of #104 and #105: ```js // input function foo () { function bar () { return 42; } var answer = bar(); console.log(answer); } // output function...

better minification