mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
removing webpack-dev-server, clean up
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
1 parent
398af8cc07
commit
faaa8034c9
7 files changed
+42
-924
No files matched your search
@@ -13,7 +13,7 @@ import type { Options as TSLoaderOptions } from "ts-loader";
|
||||
*/
|
||||
const getTSLoader = (options: Partial<TSLoaderOptions> = {}, testRegExp?: RegExp) => {
|
||||
testRegExp ??= /\.tsx?$/; // by default covers react/jsx-stuff
|
||||
options.transpileOnly ??= true; // requirement for "react-refresh-typescript"
|
||||
options.transpileOnly ??= true;
|
||||
|
||||
if (process.env.LENS_DEV_USE_ESBUILD_LOADER === "true") {
|
||||
console.info(`\n🚀 using esbuild-loader for ts(x)`);
|
||||
|
||||
@@ -38,7 +38,6 @@ export const mainDir = path.join(contextDir, "src/main");
|
||||
export const rendererDir = path.join(contextDir, "src/renderer");
|
||||
export const htmlTemplate = path.resolve(rendererDir, "template.html");
|
||||
export const sassCommonVars = path.resolve(rendererDir, "components/vars.scss");
|
||||
export const webpackDevServerPort = 9009;
|
||||
|
||||
// Special runtime paths
|
||||
defineGlobal("__static", {
|
||||
|
||||
+1
-27
@@ -9,13 +9,7 @@ import type http from "http";
|
||||
import path from "path";
|
||||
import { readFile } from "fs-extra";
|
||||
import type { Cluster } from "../common/cluster/cluster";
|
||||
import {
|
||||
apiPrefix,
|
||||
appName,
|
||||
isDevelopment,
|
||||
publicPath,
|
||||
webpackDevServerPort,
|
||||
} from "../common/vars";
|
||||
import { apiPrefix, appName, publicPath } from "../common/vars";
|
||||
import {
|
||||
HelmApiRoute,
|
||||
KubeconfigRoute,
|
||||
@@ -147,26 +141,6 @@ export class Router {
|
||||
}
|
||||
|
||||
try {
|
||||
// redirect requests to [appName].js, [appName].html /sockjs-node/ to webpack-dev-server (for hot-reload support)
|
||||
const filename = path.basename(req.url);
|
||||
const toWebpackDevServer = filename.includes(appName) || filename.includes("hot-update") || req.url.includes("sockjs-node");
|
||||
|
||||
if (isDevelopment) {
|
||||
logger.info(`[ROUTER]: handling request`, {
|
||||
url: req.url,
|
||||
toWebpackDevServer,
|
||||
});
|
||||
|
||||
if (toWebpackDevServer) {
|
||||
const redirectLocation = `http://localhost:${webpackDevServerPort}${req.url}`;
|
||||
|
||||
response.statusCode = 307;
|
||||
response.setHeader("Location", redirectLocation);
|
||||
|
||||
return response.end();
|
||||
}
|
||||
}
|
||||
|
||||
const data = await readFile(asset);
|
||||
|
||||
response.setHeader("Content-Type", getMimeType(asset));
|
||||
|
||||
Reference in new issue
Block a user