How do I load policies with Webpack?

All the examples I've found online for loading shims / polyfills in webpack are examples:

plugins: [  
    new webpack.ProvidePlugin({
          Promise: 'imports-loader?this=>global!exports-loader?global.Promise!es6-promise',
          fetch: 'imports-loader?this=>global!exports-loader?global.fetch!fetch'
     })
]

      

.. This is great, but what about polyfills that fix functionality rather than introduce new ones? IE, a customElement

polyfill for using WebComponents. There is not one specific global that maps to a polyfill, like Promise or Fetch. it increases significantly document.registerElement

.

How would you polyfill something like this in webpack? Example: https://github.com/webcomponents/custom-elements

+3


source to share





All Articles