mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Move devserver to different port (#5224)
* Move devserver to different port Signed-off-by: DmitriyNoa <dmytro.zharkov@gmail.com> * Move port to common vars Signed-off-by: DmitriyNoa <dmytro.zharkov@gmail.com> * Use Number to cast Signed-off-by: DmitriyNoa <dmytro.zharkov@gmail.com>
This commit is contained in:
parent
3b7b018084
commit
0ba5a12506
@ -135,3 +135,5 @@ export const appSemVer = new SemVer(packageInfo.version);
|
||||
export const docsUrl = "https://docs.k8slens.dev/main/" as string;
|
||||
|
||||
export const sentryDsn = packageInfo.config?.sentryDsn ?? "";
|
||||
|
||||
export const webpackDevServerPort: number = Number(process.env.WEBPACK_DEV_SERVER_PORT) || 9191;
|
||||
|
||||
@ -8,7 +8,7 @@ import type { SupportedFileExtension } from "../router/router-content-types";
|
||||
import { contentTypes } from "../router/router-content-types";
|
||||
import logger from "../logger";
|
||||
import { routeInjectionToken } from "../router/router.injectable";
|
||||
import { appName, publicPath } from "../../common/vars";
|
||||
import { appName, publicPath, webpackDevServerPort } from "../../common/vars";
|
||||
import path from "path";
|
||||
import isDevelopmentInjectable from "../../common/vars/is-development.injectable";
|
||||
import httpProxy from "http-proxy";
|
||||
@ -74,7 +74,7 @@ const handleStaticFileInDevelopment =
|
||||
}
|
||||
|
||||
proxy.web(req, res, {
|
||||
target: "http://127.0.0.1:8080",
|
||||
target: `http://127.0.0.1:${webpackDevServerPort}`,
|
||||
});
|
||||
|
||||
return { proxy };
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
import Webpack from "webpack";
|
||||
import WebpackDevServer from "webpack-dev-server";
|
||||
import { webpackLensRenderer } from "./webpack.renderer";
|
||||
import { buildDir } from "./src/common/vars";
|
||||
import { buildDir, webpackDevServerPort } from "./src/common/vars";
|
||||
import logger from "./src/common/logger";
|
||||
|
||||
/**
|
||||
@ -26,6 +26,7 @@ function createDevServer(): WebpackDevServer {
|
||||
},
|
||||
allowedHosts: "all",
|
||||
host: "localhost",
|
||||
port: webpackDevServerPort,
|
||||
static: buildDir, // aka `devServer.contentBase` in webpack@4
|
||||
hot: "only", // use HMR only without errors
|
||||
liveReload: false,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user