Browse Source

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.
bubble
Josh Ponelat 7 years ago
parent
commit
9e6e660a93
5 changed files with 7 additions and 0 deletions
  1. +2
    -0
      src/polyfills.js
  2. +1
    -0
      webpack-dist-bundle.config.js
  3. +1
    -0
      webpack-dist-standalone.config.js
  4. +1
    -0
      webpack-dist.config.js
  5. +2
    -0
      webpack-hot-dev-server.config.js

+ 2
- 0
src/polyfills.js View File

@@ -0,0 +1,2 @@
// Promise global, Used ( at least ) by 'whatwg-fetch'. And required by IE 11
require("core-js/fn/promise")

+ 1
- 0
webpack-dist-bundle.config.js View File

@@ -13,6 +13,7 @@ module.exports = require('./make-webpack-config.js')({

entry: {
'swagger-ui-bundle': [
'./src/polyfills',
'./src/core/index.js'
]
},


+ 1
- 0
webpack-dist-standalone.config.js View File

@@ -13,6 +13,7 @@ module.exports = require('./make-webpack-config.js')({

entry: {
'swagger-ui-standalone-preset': [
'./src/polyfills',
'./src/standalone/index.js'
]
},


+ 1
- 0
webpack-dist.config.js View File

@@ -15,6 +15,7 @@ module.exports = require("./make-webpack-config.js")({
entry: {
"swagger-ui": [
"./src/style/main.scss",
"./src/polyfills",
"./src/core/index.js"
]
},


+ 2
- 0
webpack-hot-dev-server.config.js View File

@@ -10,10 +10,12 @@ module.exports = require("./make-webpack-config")({
devtool: "eval",
entry: {
'swagger-ui-bundle': [
'./src/polyfills',
'./src/core/index.js'
],
'swagger-ui-standalone-preset': [
'webpack/hot/dev-server',
'./src/polyfills',
'./src/standalone/index.js',
]
},


Loading…
Cancel
Save