Maybe with this: https://polyfill.io/v2/docs/features/#Promise
How to properly include it in application?
Hi, @ezhkov!
I fix IE11 problems with babel-polyfill:
nuxt.config.js
build: {
vendor: [
'babel-polyfill'
]
}
don't forget to: npm install babel-polyfill
Sorry, don't sure if it resolve promise errors. I'm using it for Symbol.
Konstantin, great solution. Thanks.
I found another one
build: {
extend(config, { isClient }) {
if (isClient) {
config.entry.vendor.push('babel-polyfill')
}
}
}
I like yours much more )
Would it possible to do feature detection in nuxt and load a built vendor bundle with only the libraries needed?
like:
if (!window.fetch && !window.Promise) {
//load vendor bundle with fetch and promise polyfill included
}
if (!window.Promise) {
//load vendor bundle with only promise pollyfill included
}
//and so on
The vendor builds could be lighter. yepnope suggested this technique in their deprecation notice.
This could be extended to not load any js at all if not supported: BBC coined the term Cutting the mustard.
I think this would be a great option to extend the already great progressive enhancement functionality of nuxt.
Hi, @laterne! I think it's could be a good feature request, but probably you should create a new issue.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Hi, @ezhkov!
I fix IE11 problems with babel-polyfill:
nuxt.config.js
don't forget to: npm install babel-polyfill