Home

Issue: 2700

Insert script tags *before* the usual bundles

[issue link]

I’m trying to insert polyfills from https://polyfills.io. The issue is that the following method will not work:

    script: [
      {src: 'https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,es7,es2017', body: true, defer: true}
    ]

This will result in the polyfill be loaded after the bundles, which just doesn’t make sense. We need an option (or default) to make it inserted before bundles.

(A workaround would be just putting it inside head, but it creates blocking traffic which reduces PageSpeed/lighthouse score.)

This question is available on Nuxt.js community (#c2345)