- Remove
import 'react-app-polyfill/ie11'
from your index.js and put it in a new filesrc/polyfill.js
- install webpack-cli
yarn add -D webpack-cli
ornpm i -D webpack-cli
- add npm script
"polyfill": "webpack -p ./src/polyfill.js -o ./build/ie11.js"
- add to build script
"build": "react-scripts build && npm run polyfill",
- add
<script src="%PUBLIC_URL%/ie11.js" nomodule></script>
to the<head>
ofpublic/index.html
Last active
February 7, 2020 11:40
-
-
Save evertbouw/177a728c70fe14b7714a03f2e1d4b512 to your computer and use it in GitHub Desktop.
How to add the create-react-app polyfill for IE11 only
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment