1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Add a global Promise polyfill. (#1344)

* Add a global Promise polyfill.
This is because Webpack2 depends on it.

* Change the polyfill location.
This commit is contained in:
Arunoda Susiripala 2017-03-04 22:18:33 +05:30 committed by Dan Zajdband
parent 888a029c75
commit 62fcb2b664

View file

@ -7,6 +7,15 @@ import App from '../lib/app'
import evalScript from '../lib/eval-script'
import { loadGetInitialProps, getURL } from '../lib/utils'
// Polyfill Promise globally
// This is needed because Webpack2's dynamic loading(common chunks) code
// depends on Promise.
// So, we need to polyfill it.
// See: https://github.com/webpack/webpack/issues/4254
if (!window.Promise) {
window.Promise = Promise
}
const {
__NEXT_DATA__: {
component,