Created
February 11, 2021 14:45
-
-
Save matheus1lva/ea6b4082283361d5db451f23559e365e to your computer and use it in GitHub Desktop.
webpack-polyfilling
This file contains hidden or 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
// 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