Skip to content

Instantly share code, notes, and snippets.

@mogelbrod
Last active December 5, 2023 22:18
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mogelbrod/3bebd3678618b24566772586e52638e6 to your computer and use it in GitHub Desktop.
Save mogelbrod/3bebd3678618b24566772586e52638e6 to your computer and use it in GitHub Desktop.
Prevent core-js polyfills of APIs that should be supported by IE11 for general use (incomplete list)
module.exports = {
presets: [
['@babel/preset-env', {
useBuiltIns: 'usage',
debug: false,
loose: true,
corejs: {
version: 3,
proposals: true,
},
// Exclude polyfills for features whose main usage is supported in IE11
// see https://caniuse.com/?serach=[query] for support data
exclude: [
'es.array.concat',
'es.array.join',
'es.array.slice',
'es.number.*', // as long as you use the global functions instead (parseInt, parseFloat, isNaN, etc.)
'es.object.keys',
'es.object.to-string',
'es.regexp.to-string',
'es.string.match', // as long as you don't use newer regex modifiers or syntax
'es.string.replace', // as long as you don't use newer regex modifiers or syntax
'es.string.split', // as long as you don't use newer regex modifiers or syntax
],
}],
],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment