diff --git a/webpack.config.js b/webpack.config.js index f848f65..8bdbe24 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,4 +1,5 @@ const path = require("path"); +const webpack = require("webpack"); const TerserPlugin = require("terser-webpack-plugin"); module.exports = { @@ -9,6 +10,16 @@ module.exports = { path: __dirname, libraryTarget: "commonjs", }, + plugins: [ + // Work around for Buffer is undefined: + // https://github.com/webpack/changelog-v5/issues/10 + new webpack.ProvidePlugin({ + Buffer: ["buffer", "Buffer"], + }), + new webpack.ProvidePlugin({ + process: "process/browser", + }), + ], module: { rules: [ {