Skip to content

Commit

Permalink
feat(webpack-plugin): add http/https polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
flyfishzy committed Feb 28, 2022
1 parent 80d4e6d commit 30cb78c
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 4 deletions.
4 changes: 4 additions & 0 deletions packages/webpack-plugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,17 @@ module.exports = class OpenharmonyPolyfillPlugin {
crypto: require.resolve('crypto-browserify'),
domain: require.resolve('domain-browser'),
events: require.resolve('events/'),
// TODO: rewrite with openharmony http api
http: require.resolve('stream-http'),
https: require.resolve('https-browserify'),
os: require.resolve('os-browserify/browser'),
path: require.resolve('path-browserify'),
process: require.resolve('process/browser'),
querystring: require.resolve('querystring-es3'),
stream: require.resolve('stream-browserify'),
string_decoder: require.resolve('string_decoder/'),
sys: require.resolve('util/'),
url: require.resolve('url/'),
util: require.resolve('util/')
},
this.options.excludeAliases
Expand Down
5 changes: 4 additions & 1 deletion packages/webpack-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@
"domain-browser": "^4.19.0",
"events": "^3.3.0",
"filter-obj": "^2.0.2",
"openharmony-polyfill": "^0.5.0",
"https-browserify": "^1.0.0",
"openharmony-polyfill": "^0.6.0",
"os-browserify": "^0.3.0",
"path-browserify": "^1.0.1",
"process": "^0.11.10",
"querystring-es3": "^0.2.1",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"string_decoder": "^1.3.0",
"url": "^0.11.0",
"util": "^0.12.4"
},
"devDependencies": {
Expand Down
55 changes: 52 additions & 3 deletions pnpm-lock.yaml

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

0 comments on commit 30cb78c

Please sign in to comment.