Timkor / nuxt-polyfill

Ease adding polyfills to your Nuxt.js project
MIT License
97 stars 1 forks source link

Download on specific page #11

Closed ungarson closed 3 years ago

ungarson commented 4 years ago

Hi, I guess it would be useful if users could download specific polyfills on specific paths or pages. Example of the nuxt config:

export default {
  polyfill: {
    features: [
      {
        require: 'url-search-params-polyfill',
        detect: () => 'URLSearchParams' in window,
        pages: [
          '/auth/:id',
          '/some-other/'
        ]
      }
    ]
  }
}

Why? Because in this example I don't use 'url-search-params-polyfill' everywhere, so I guess it'd be better if we could save user's traffic. Thanks!

ungarson commented 3 years ago

I'm going to close it, since 0 activity