Skip to content

Commit 22a56e9

Browse files
committed
fix: remove universal-hot-reload and webpack-serve from examples
Remove universal-hot-reload and webpack-serve devDependencies from both example apps. These packages pulled in vulnerable transitive deps: - webpack-dev-server@3.x (GHSA-9hcv-j9pv-qmph) - uuid@3.4.0 (GHSA-rr56-j5qj-qrhg) - node-forge@0.10.0 (multiple CVEs) Replace with explicit webpack CLI build scripts. The examples now use 'npm run build' to compile client/server bundles and 'npm start' to build and run the server. Hot module replacement is removed as these examples are for a deprecated SDK.
1 parent b5a4c27 commit 22a56e9

6 files changed

Lines changed: 5290 additions & 7979 deletions

File tree

examples/async-provider/package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"description": "Example usage of launchdarkly-react-client-sdk",
55
"main": "src/server/index.js",
66
"scripts": {
7-
"start": "NODE_OPTIONS=--openssl-legacy-provider node src/server/index.js",
7+
"build": "NODE_OPTIONS=--openssl-legacy-provider webpack --config webpack.config.client.js && NODE_OPTIONS=--openssl-legacy-provider webpack --config webpack.config.server.js",
8+
"start": "npm run build && node dist/serverBundle.js",
89
"lint": "eslint ./src",
9-
"serve": "webpack-serve webpack.config.server",
1010
"postinstall": "cd ../../ && yarn link-dev"
1111
},
1212
"repository": {
@@ -53,11 +53,9 @@
5353
"eslint-plugin-import": "^2.14.0",
5454
"eslint-plugin-jsx-a11y": "^6.1.2",
5555
"eslint-plugin-react": "^7.11.1",
56-
"universal-hot-reload": "^3.3.4",
5756
"webpack": "^4.39.3",
5857
"webpack-cli": "^3.3.7",
59-
"webpack-node-externals": "^1.7.2",
60-
"webpack-serve": "^3.1.1"
58+
"webpack-node-externals": "^1.7.2"
6159
},
6260
"resolutions": {
6361
"acorn": "npm:acorn-with-stage3"
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
1-
const UniversalHotReload = require('universal-hot-reload').default;
2-
3-
// supply your own webpack configs
4-
const serverConfig = require('../../webpack.config.server.js');
5-
const clientConfig = require('../../webpack.config.client.js');
6-
7-
// the configs are optional, you can supply either one or both.
8-
// if you omit say the server config, then your server won't hot reload.
9-
UniversalHotReload({ serverConfig, clientConfig });
1+
require('../../dist/serverBundle');

0 commit comments

Comments
 (0)