overwrite buffer

This commit is contained in:
fyears 2021-11-02 10:07:00 +08:00
parent a9d80bef8f
commit da180fcc92

View File

@ -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: [
{