Skip to content

Commit

Permalink
Merge pull request #1854 from Godsenal/update-browser-example
Browse files Browse the repository at this point in the history
Update browser example to support nodejs polyfill
  • Loading branch information
h3poteto authored Aug 16, 2023
2 parents 1eabe26 + 44959dc commit 85dea2e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions example/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"http-server": "^14.1.1",
"https-browserify": "^1.0.0",
"os-browserify": "^0.3.0",
"process": "^0.11.10",
"querystring-es3": "^0.2.1",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
Expand Down
4 changes: 4 additions & 0 deletions example/browser/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ module.exports = {
new webpack.DefinePlugin({
'process.browser': true,
'process.env.NODE_DEBUG': false
}),
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
process: 'process/browser'
})
]
// https-proxy-agent and socks-proxy-agent is node library, so can't compile for browser.
Expand Down

0 comments on commit 85dea2e

Please sign in to comment.