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
+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