Skip to content

Commit

Permalink
fix: ponyfill process in browser
Browse files Browse the repository at this point in the history
Fixes error: ReferenceError: process is not defined
`process` referenced in pbkdf2 package
  • Loading branch information
davidyuk committed Jun 5, 2021
1 parent 925aee8 commit 798ab63
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
3 changes: 1 addition & 2 deletions 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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"joi-browser": "^13.4.0",
"libsodium-wrappers-sumo": "0.7.9",
"path-browserify": "^1.0.1",
"process": "^0.11.10",
"ramda": "^0.27.1",
"rlp": "2.2.6",
"sha.js": "^2.4.11",
Expand Down
12 changes: 8 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const webpack = require('webpack')
const path = require('path')
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')

Expand All @@ -24,13 +25,16 @@ function configure (filename, opts = {}) {
crypto: require.resolve('crypto-browserify')
}
},
plugins: argv.report ? [
new BundleAnalyzerPlugin({
plugins: [
...opts.target === 'node' ? [] : [new webpack.ProvidePlugin({
process: 'process'
})],
...argv.report ? [new BundleAnalyzerPlugin({
analyzerMode: 'static',
reportFilename: filename + '.html',
openAnalyzer: false
})
] : [],
})] : []
],
output: {
path: path.resolve(__dirname, 'dist'),
filename,
Expand Down

0 comments on commit 798ab63

Please sign in to comment.