Created
October 19, 2019 08:21
-
-
Save endiliey/5f9ffc0d318becb425ea70305c6aa3c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function getIePolyfill(siteDir: string) { | |
let iePolyfill = ''; | |
const env = | |
process.env.NODE_ENV === 'production' ? 'production' : 'development'; | |
const supportedBrowsers = browserslist(undefined, {path: siteDir, env}); | |
if ( | |
supportedBrowsers.includes('ie 9') || | |
supportedBrowsers.includes('ie 10') | |
) { | |
iePolyfill = 'react-app-polyfill/ie9'; | |
} else if (supportedBrowsers.includes('ie 11')) { | |
iePolyfill = 'react-app-polyfill/ie11'; | |
} | |
return iePolyfill; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment