7

I was watching an Advanced Webpack video. Right at about the 10 minute mark he talks about detecting whether you need the Babel-Polyfill at runtime and then loading it if you need it. I found this very interesting. I conversed with him but twitter is to short of a format to answer my questions fully:

if (!feature) require("./polyBundle");

Was his recommendation which i full understand. My question is what feature/features do i need to look for? Do i need to include Modernizr? If i have to look for multiple features do i have to track Babel-Polyfill ever time i update it to see if i need to add/subtract features from the list?

coding4fun
  • 8,038
  • 13
  • 58
  • 85
  • Is the size difference truly critical for your usecase? The answer is that this would require a ton of custom logic on your part that will be hard to maintain. The expected usage is that you load the polyfill and let it decide what it needs to override. What you're asking is to essentially duplicate that logic in your own code. – loganfsmyth Jul 06 '16 at 17:00
  • @loganfsmyth I was hoping to use this technique for babel polyfill but everything else like fetch polyfill, es6 polyfill, ect? Not worth it? Couldn't possible use Modernizr for feature detection? just trying to keep our page payload as small as possible. – coding4fun Jul 06 '16 at 19:24

0 Answers0