make rspack error when the port is already in use (#55803)

* make rspack error when the port is already in use

* adds rspack.config.js to the frontend_sources on file-paths

* use PORT env
This commit is contained in:
Nicolò Pretto
2025-03-27 15:48:22 +04:00
committed by GitHub
parent 3a865cc16b
commit f5f4dbbc4b
2 changed files with 4 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ frontend_sources: &frontend_sources
- "babel.config.json"
- ".eslintrc.js"
- "postcss.config.js"
- "rspack.config.js"
- "webpack.config.js"
- "webpack.embedding-sdk.config.js"
- "webpack.static-viz.config.js"

View File

@@ -23,6 +23,7 @@ const TEST_SUPPORT_PATH = __dirname + "/frontend/test/__support__";
const BUILD_PATH = __dirname + "/resources/frontend_client";
const E2E_PATH = __dirname + "/e2e";
const PORT = process.env.PORT || 8080;
const WEBPACK_BUNDLE = process.env.WEBPACK_BUNDLE || "development";
const devMode = WEBPACK_BUNDLE !== "production";
const shouldEnableHotRefresh = WEBPACK_BUNDLE === "hot";
@@ -304,9 +305,10 @@ if (shouldEnableHotRefresh) {
// point the publicPath (inlined in index.html by HtmlWebpackPlugin) to the hot-reloading server
config.output.publicPath =
"http://localhost:8080/" + config.output.publicPath;
`http://localhost:${PORT}/` + config.output.publicPath;
config.devServer = {
port: PORT, // make the port explicit so it errors if it's already in use
hot: true,
client: {
progress: false,