Skip to content

Instantly share code, notes, and snippets.

@matheus1lva
Created February 11, 2021 14:45
Show Gist options
  • Save matheus1lva/ea6b4082283361d5db451f23559e365e to your computer and use it in GitHub Desktop.
Save matheus1lva/ea6b4082283361d5db451f23559e365e to your computer and use it in GitHub Desktop.
webpack-polyfilling
// 1.:
module.exports = {
entry: './src/index.js'
}
// index.js
fetch = myFetch
// 2:
module.exports = {
entry: ['myCustomPolyfill', './src/index.js']
}
// myCustomPolyfill.js
fetch = myFetch
// 3:
module.exports = {
entry: './src/index.js',
plugins: [
new webpack.ProvidePlugin({
fetch: 'something'
})
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment