- 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-cliornpm 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
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