Open ehoogeveen-medweb opened 4 years ago
FWIW, minify-dead-code-elimination
appears to have the same problem, removing the null check for native String.prototype.startsWith()
, so I've now added deadcode: false
too.
The plugin minify-type-constructors
also causes an issue, as it transforms String(Symbol())
(which evaluates to "Symbol()"
) to '' + Symbol()
(which is a type error). core-js uses this as part of its test for native Symbol support.
I'm building and minifying
core-js
for a specific set of browser targets usingcore-js-builder
andbabel-preset-minify
. I noticed thatNumber.prototype.toFixed()
was producing errors in IE11 and narrowed it down to the pluginbabel-plugin-minify-guarded-expressions
.Diffing the (prettified) output, I noticed that it's removing a polyfill for
String.prototype.repeat()
and a guard forString.prototype.matchAll()
, neither of which are supported by IE11. It also removes a guard forString.prototype.toFixed()
itself, but that should be okay as basic support for this is present in IE11 (even if the implementation isn't compliant).To Reproduce
I'm producing core-js using a self-contained node.js project. To reproduce, use the files below then simply run
and it should produce a file called
core-js.min.js
which is missing the required polyfill forString.prototype.repeat()
(sorry if this is an unusual set of instructions for a bug report).My
package.json
:My
babel.config.js
(I disabled every plugin exceptbabel-plugin-minify-guarded-expressions
):My
build.js
file (not sure if this is the correct way to build core-js but it works):The diff between a run with
guards: false
(which works) andguards: true
(which causes the error):Configuration
How are you using babel-minify?
babel-preset-minify in babel.config.js
babel-minify version:
0.5.1
babel version:
7.8.3
core-js-builder version:
3.6.4
babel-minify config: