1

I want to use event-source-polyfill on Nuxt 2 for ie11 hot reload.

I found: How to add a polyfill to nuxt 2.0? but my env can’t access to CDN so I need to use local polyfill, which is installed “npm install event-source-polyfill”.

I got some information about vendor option but it is deprecated on Nuxt v2 and relese note says “Use webpack4”. How do I it?

Thank to take your time.

user6864208
  • 31
  • 1
  • 5

1 Answers1

0

I have solved the problem.

First,

yarn add --dev eventsource-polyfill

then, in nuxt.config.js, add:

extend(config, ctx) {
  if(ctx.idDev) {
    config.entry.push('eventsource-polyfill')
  }
}