fix: correct Buffer polyfill in webpack config

This commit is contained in:
Christopher Willis-Ford 2024-06-07 09:44:36 -07:00
parent 015f55b462
commit 4153ad6538

View file

@ -108,7 +108,7 @@ module.exports = {
resolve: { resolve: {
fallback: { fallback: {
// Node modules are no longer polyfilled by default in Webpack 5, so we need to add these here // Node modules are no longer polyfilled by default in Webpack 5, so we need to add these here
buffer: require.resolve('buffer/'), Buffer: require.resolve('buffer/'),
stream: require.resolve('stream-browserify') // jszip stream: require.resolve('stream-browserify') // jszip
}, },
symlinks: false // Fix local development with `npm link` packages symlinks: false // Fix local development with `npm link` packages
@ -200,6 +200,9 @@ module.exports = {
new EmitFilePlugin({ new EmitFilePlugin({
filename: 'version.txt', filename: 'version.txt',
content: getVersionId content: getVersionId
}),
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer']
}) })
].concat(pageRoutes ].concat(pageRoutes
.map(route => new HtmlWebpackPlugin(defaults({}, { .map(route => new HtmlWebpackPlugin(defaults({}, {