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:
1
.github/file-paths.yaml
vendored
1
.github/file-paths.yaml
vendored
@@ -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"
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user