Skip to content

Commit

Permalink
fix: update webpack SNYK-JS-WEBPACK-7840298
Browse files Browse the repository at this point in the history
  • Loading branch information
paula-stacho committed Sep 2, 2024
1 parent dd7190e commit 063228a
Show file tree
Hide file tree
Showing 3 changed files with 1,250 additions and 1,041 deletions.
19 changes: 9 additions & 10 deletions configs/webpack-config-compass/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@
"@mongodb-js/prettier-config-compass": "^1.0.2",
"@mongodb-js/tsconfig-compass": "^1.0.4",
"@types/cli-progress": "^3.9.2",
"@types/html-webpack-plugin": "^3.2.6",
"@types/mini-css-extract-plugin": "^2.3.0",
"@types/webpack-bundle-analyzer": "^4.4.1",
"@types/html-webpack-plugin": "^3.2.9",
"@types/webpack-bundle-analyzer": "^4.7.0",
"depcheck": "^1.4.1",
"eslint": "^7.25.0",
"prettier": "^2.7.1",
Expand All @@ -66,7 +65,7 @@
"@babel/preset-typescript": "^7.21.4",
"@babel/runtime": "^7.21.0",
"@cerner/duplicate-package-checker-webpack-plugin": "^2.1.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.5",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.15",
"babel-loader": "^8.2.5",
"babel-plugin-istanbul": "^5.2.0",
"browserslist": "^4.23.3",
Expand All @@ -75,21 +74,21 @@
"core-js": "^3.17.3",
"css-loader": "^4.3.0",
"electron": "^30.4.0",
"html-webpack-plugin": "^5.3.2",
"html-webpack-plugin": "^5.6.0",
"less": "^3.13.1",
"less-loader": "^10.0.1",
"mini-css-extract-plugin": "^2.3.0",
"mini-css-extract-plugin": "^2.9.1",
"node-loader": "^2.0.0",
"postcss": "^8.4.31",
"postcss-loader": "^6.1.1",
"postcss-preset-env": "^6.7.0",
"react-refresh": "^0.10.0",
"source-map-loader": "^4.0.1",
"style-loader": "^3.2.1",
"webpack": "^5.86.0",
"webpack-bundle-analyzer": "^4.9.0",
"webpack": "^5.94.0",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.0",
"webpack-merge": "^5.9.0"
"webpack-dev-server": "^4.15.2",
"webpack-merge": "^5.10.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ export class WebpackPluginStartElectron {
const rendererEntries = Object.keys(this.rendererCompiler.options.entry);
const rendererOutputPath = this.rendererCompiler.options.output
.path as string;
const devServerPort: number =
this.rendererCompiler.options.devServer?.port ?? 4242;

const devServerPort: number = this.rendererCompiler.options.devServer
? this.rendererCompiler.options.devServer.port
: 4242;

// This will set environmental variables that can be used by main process to
// know what BrowserWindow to open exactly
Expand All @@ -77,7 +79,9 @@ export class WebpackPluginStartElectron {
return [
`COMPASS_${name.toUpperCase()}_RENDERER_URL`,
this.opts.fileUrl
? pathToFileURL(path.join(rendererOutputPath, `${name}.html`))
? pathToFileURL(
path.join(rendererOutputPath, `${name}.html`)
).toString()
: `http://localhost:${devServerPort}/${name}.html`,
];
})
Expand Down
Loading

0 comments on commit 063228a

Please sign in to comment.