Add polyfill for Promise ( only )
This is needed for whatwg-fetch + IE11. An alternative is to include "node_modules/whatwg-fetch" in the transform-runtime. But my guess is that someone is likely going to add a lib that in turn uses Promises, without adding it to the whitelist. This is safter.
This commit is contained in:
2
src/polyfills.js
Normal file
2
src/polyfills.js
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
// Promise global, Used ( at least ) by 'whatwg-fetch'. And required by IE 11
|
||||||
|
require("core-js/fn/promise")
|
||||||
@@ -13,6 +13,7 @@ module.exports = require('./make-webpack-config.js')({
|
|||||||
|
|
||||||
entry: {
|
entry: {
|
||||||
'swagger-ui-bundle': [
|
'swagger-ui-bundle': [
|
||||||
|
'./src/polyfills',
|
||||||
'./src/core/index.js'
|
'./src/core/index.js'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ module.exports = require('./make-webpack-config.js')({
|
|||||||
|
|
||||||
entry: {
|
entry: {
|
||||||
'swagger-ui-standalone-preset': [
|
'swagger-ui-standalone-preset': [
|
||||||
|
'./src/polyfills',
|
||||||
'./src/standalone/index.js'
|
'./src/standalone/index.js'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ module.exports = require("./make-webpack-config.js")({
|
|||||||
entry: {
|
entry: {
|
||||||
"swagger-ui": [
|
"swagger-ui": [
|
||||||
"./src/style/main.scss",
|
"./src/style/main.scss",
|
||||||
|
"./src/polyfills",
|
||||||
"./src/core/index.js"
|
"./src/core/index.js"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -10,10 +10,12 @@ module.exports = require("./make-webpack-config")({
|
|||||||
devtool: "eval",
|
devtool: "eval",
|
||||||
entry: {
|
entry: {
|
||||||
'swagger-ui-bundle': [
|
'swagger-ui-bundle': [
|
||||||
|
'./src/polyfills',
|
||||||
'./src/core/index.js'
|
'./src/core/index.js'
|
||||||
],
|
],
|
||||||
'swagger-ui-standalone-preset': [
|
'swagger-ui-standalone-preset': [
|
||||||
'webpack/hot/dev-server',
|
'webpack/hot/dev-server',
|
||||||
|
'./src/polyfills',
|
||||||
'./src/standalone/index.js',
|
'./src/standalone/index.js',
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user