Skip to content

Commit

Permalink
Stop using internal webpack importer for eventsource
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic committed Nov 15, 2023
1 parent 29aaf8a commit 2913ccd
Show file tree
Hide file tree
Showing 3 changed files with 509 additions and 495 deletions.
11 changes: 5 additions & 6 deletions config/webpack.config.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,18 @@ const config = {
new ESLintPlugin({
overrideConfigFile: path.resolve(__dirname, '../.eslintrc.js')
}),
// Ignore native modules (sodium-native)
new webpack.IgnorePlugin({ resourceRegExp: /sodium-native/ }),
// Should be polyfilled
// Ignore native modules (sodium-native) and opt-in polyfills
new webpack.IgnorePlugin({ resourceRegExp: /(sodium-native|eventsource)/ }),
new webpack.IgnorePlugin({ resourceRegExp: /eventsource/ }),
new NodePolyfillPlugin({
includeAliases: ['http', 'https'] // others aren't needed
}),
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer']
})
}),
],
watchOptions: {
ignored: /(node_modules|coverage|lib|dist)/
externals: {
"eventsource": "require('eventsource')"
}
};

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@
"eslint-plugin-prefer-import": "^0.0.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-webpack-plugin": "^4.0.1",
"eventsource": "^2.0.2",
"ghooks": "^2.0.4",
"husky": "^8.0.3",
"jsdoc": "^4.0.2",
Expand Down
Loading

0 comments on commit 2913ccd

Please sign in to comment.