Polyfill Node.js core modules in Webpack.
This module is only needed for Webpack 5+.
npm install gopeed-polyfill-webpack-pluginAdd the following to your webpack.config.js:
const GopeedPolyfillPlugin = require('gopeed-polyfill-webpack-plugin');
module.exports = {
// Other rules...
plugins: [
new GopeedPolyfillPlugin()
]
};Type: object
excludeAliases and includeAliases are mutually exclusive.
By default, the modules that were polyfilled in Webpack 4 are mirrored over. However, if you don't want a module like process to be polyfilled you can specify alises to be skipped here.
const GopeedPolyfillPlugin = require('gopeed-polyfill-webpack-plugin');
module.exports = {
// Other rules...
plugins: [
new GopeedPolyfillPlugin({
excludeAliases: ['process']
})
]
};Alternatively, you can choose to only include certain aliases. For example, you can only have process polyfilled.
const GopeedPolyfillPlugin = require('gopeed-polyfill-webpack-plugin');
module.exports = {
// Other rules...
plugins: [
new GopeedPolyfillPlugin({
includeAliases: ['process']
})
]
};Bufferprocess
assertbufferconsoleconstantscryptodomaineventshttphttpsospathpunycodeprocessquerystringstream_stream_duplex_stream_passthrough_stream_readable_stream_transform_stream_writablestring_decodersystimersttyurlutilvmzlib