fix: add a missing ProvidePlugin to the webpack.config in new projects
const path = require("path");
+const webpack = require("webpack");
const HtmlWebpackPlugin = require('html-webpack-plugin');
const TerserPlugin = require("terser-webpack-plugin");
const dfxJson = require("./dfx.json");
@@ -79,6 +80,10 @@ function generateWebpackConfigForCanister(name, info) {
filename: 'index.html',
chunks: ['index'],
}),
+ new webpack.ProvidePlugin({
+ Buffer: [require.resolve('buffer/'), 'Buffer'],
+ process: require.resolve('process/browser'),
+ }),
],
};
}
