scottcharlesworth / laravel-mix-polyfill

A Laravel Mix extension to include polyfills by using Babel, core-js, and regenerator-runtime
MIT License
50 stars 7 forks source link

Polyfills do not work with `.extract()` #29

Closed KorvinSzanto closed 4 years ago

KorvinSzanto commented 4 years ago

If you use mix.extract() to extract vendor files polyfills don't seem to apply to the outputted vendors.js file. My specific situation was trying to polyfill the spread operator for legacy edge, no matter what I tried the vendor.js file didn't get the polyfills. Thankfully I was able to just stop using .extract to get around this but that's not ideal.

scottcharlesworth commented 4 years ago

@KorvinSzanto it is interesting that you are able to get the vendor libraries to polyfill by just omitting .extract() as the contents of node_modules is excluded by default in Laravel Mix.

However if you see the answer here you should be able to use .extract() and polyfill the vendor libraries.