Skip to content

Commit

Permalink
Fix buffer not resolvable in webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Aug 1, 2024
1 parent 633801d commit 3af8a04
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
65 changes: 65 additions & 0 deletions javascript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.5.0",
"babel-loader": "^9.1.3",
"buffer": "^6.0.3",
"eslint": "^6.4.0",
"eslint-config-google": "^0.14.0",
"globals": "^15.6.0",
Expand Down
6 changes: 6 additions & 0 deletions javascript/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ module.exports = {
},
resolve: {
extensions: ['.js'],
fallback: {
buffer: require.resolve('buffer/'),
},
},
mode: 'development', // Change to 'production' for production builds
plugins: [
Expand All @@ -33,5 +36,8 @@ module.exports = {
APP_ENV: JSON.stringify('browser'),
},
}),
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
],
};

0 comments on commit 3af8a04

Please sign in to comment.