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:
parent
888a029c75
commit
62fcb2b664
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue