J
J
jeruthadam2017-08-25 02:06:01
JavaScript
jeruthadam, 2017-08-25 02:06:01

How to use polyfill.io in SPA built by webpack? Is it possible to include a script in head in SPA?

The app is built with webpack. How to properly organize the work of polyfil.io?
As far as I understood from the documentation, it itself determines the browser that accesses the CDN and dynamically gives the script. But then the questions are
: index.html file that bundle.js is connected to?
2. Is it possible to connect this library inside the application itself, and pack all the bundle? Does it make sense? After all, then I won’t be able to selectively give user agents only the necessary polyfill (and they weigh decently)? HOW CORRECT?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan, 2017-08-25
@LiguidCool

If in doubt - try it :)
You can always connect it simply to the "header" separately from the "bundle".
In general, in the description "in black and white" it is written that it determines the browser from the user agent. So most likely it is better not to pack it in a bundle.
On the other hand, why do you need a polyfill at all? As I understand it, it gives certain functionality in outdated browsers? Since you have a webpack, then compile the bundle compatible with older browsers via Babel .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question