mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
move webpackDevServerPort to webpack/vars
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
c2d1c574f6
commit
d355a8d16a
@ -127,5 +127,3 @@ 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, staticFilesDirectory, webpackDevServerPort } from "../../common/vars";
|
||||
import { appName, publicPath, staticFilesDirectory } from "../../common/vars";
|
||||
import path from "path";
|
||||
import isDevelopmentInjectable from "../../common/vars/is-development.injectable";
|
||||
import httpProxy from "http-proxy";
|
||||
@ -17,6 +17,7 @@ import type { GetAbsolutePath } from "../../common/path/get-absolute-path.inject
|
||||
import getAbsolutePathInjectable from "../../common/path/get-absolute-path.injectable";
|
||||
import type { JoinPaths } from "../../common/path/join-paths.injectable";
|
||||
import joinPathsInjectable from "../../common/path/join-paths.injectable";
|
||||
import { webpackDevServerPort } from "../../../webpack/vars";
|
||||
|
||||
interface ProductionDependencies {
|
||||
readFileBuffer: (path: string) => Promise<Buffer>;
|
||||
|
||||
@ -7,7 +7,7 @@ import Webpack from "webpack";
|
||||
import WebpackDevServer from "webpack-dev-server";
|
||||
import { webpackLensRenderer } from "./renderer";
|
||||
import logger from "../src/common/logger";
|
||||
import { buildDir } from "./vars";
|
||||
import { buildDir, webpackDevServerPort } from "./vars";
|
||||
|
||||
/**
|
||||
* API docs:
|
||||
@ -24,6 +24,7 @@ const server = new WebpackDevServer({
|
||||
},
|
||||
allowedHosts: "all",
|
||||
host: "localhost",
|
||||
port: webpackDevServerPort,
|
||||
static: buildDir, // aka `devServer.contentBase` in webpack@4
|
||||
hot: "only", // use HMR only without errors
|
||||
liveReload: false,
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import assert from "assert";
|
||||
import path from "path";
|
||||
import packageInfo from "../package.json";
|
||||
|
||||
@ -19,3 +20,6 @@ export const appName = isDevelopment
|
||||
export const htmlTemplate = path.resolve(rendererDir, "template.html");
|
||||
export const publicPath = "/build/";
|
||||
export const sassCommonVars = path.resolve(rendererDir, "components/vars.scss");
|
||||
export const webpackDevServerPort = Number(process.env.WEBPACK_DEV_SERVER_PORT) || 9191;
|
||||
|
||||
assert(Number.isInteger(webpackDevServerPort), "WEBPACK_DEV_SERVER_PORT environment variable must only be an integer");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user