Skip to content

Commit

Permalink
Fix: Add Promise polyfill for IE11 because require.ensure requires it…
Browse files Browse the repository at this point in the history
… in webpack 2
  • Loading branch information
sapegin committed May 30, 2017
1 parent 7d94e87 commit e4f49b3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"common-dir": "^1.0.1",
"css-loader": "^0.28.1",
"es6-object-assign": "~1.1.0",
"es6-promise": "^4.1.0",
"escodegen": "^1.8.1",
"findup": "^0.1.5",
"function.name-polyfill": "^1.0.5",
Expand Down
6 changes: 1 addition & 5 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './polyfills';
import './styles';
import React from 'react';
import ReactDOM from 'react-dom';
Expand All @@ -13,11 +14,6 @@ import {
} from './utils/utils';
import StyleGuide from 'rsg-components/StyleGuide';

// Polyfills
import 'function.name-polyfill';
import es6ObjectAssign from 'es6-object-assign';
es6ObjectAssign.polyfill();

// Examples code revision to rerender only code examples (not the whole page) when code changes
let codeKey = 0;

Expand Down
8 changes: 8 additions & 0 deletions src/polyfills.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Function.name for IE11
import 'function.name-polyfill';

// Object.assign() for IE11
import 'es6-object-assign/auto';

// Promise to support webpack 2 require.ensure() in IE11
import 'es6-promise/auto';
8 changes: 6 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1312,14 +1312,14 @@ browserify-zlib@^0.1.4:
dependencies:
pako "~0.2.0"

browserslist@1.7.5, browserslist@^1.4.0:
browserslist@1.7.5:
version "1.7.5"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-1.7.5.tgz#eca4713897b51e444283241facf3985de49a9e2b"
dependencies:
caniuse-db "^1.0.30000624"
electron-to-chromium "^1.2.3"

browserslist@^1.3.6, browserslist@^1.5.2, browserslist@^1.7.6:
browserslist@^1.3.6, browserslist@^1.4.0, browserslist@^1.5.2, browserslist@^1.7.6:
version "1.7.7"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-1.7.7.tgz#0bd76704258be829b2398bb50e4b62d1a166b0b9"
dependencies:
Expand Down Expand Up @@ -2395,6 +2395,10 @@ es6-object-assign@~1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/es6-object-assign/-/es6-object-assign-1.1.0.tgz#c2c3582656247c39ea107cb1e6652b6f9f24523c"

es6-promise@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.1.0.tgz#dda03ca8f9f89bc597e689842929de7ba8cebdf0"

es6-set@~0.1.5:
version "0.1.5"
resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1"
Expand Down

0 comments on commit e4f49b3

Please sign in to comment.