Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No, the point of this tool is that some browsers require a polyfill, and some don't because the feature is natively supported. A transpiler like Babel cannot possibly determine that, so it has to be safe and include polyfills for all features used in the code it's transpiling, reglardless of whether or not the browser you're using already supports the feature.

A good example of this is Promises, which are supported in many modern browsers, but not all.



Yet this is exactly what babel-runtime will do for you: include all the polyfills. If you're not targetting IE8 and you don't care about Intl won't actually be that much code.

If you're using webpack you can use the code splitting feature to make sure the browser doesn't download that extra few KBs (which is presumable a trade-off between (an) extra roundtrip(s), so maybe you should just swallow those KBs).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: