Skip to content

Commit

Permalink
remove HOT_RELOAD path from server code
Browse files Browse the repository at this point in the history
  • Loading branch information
sdumetz committed Jan 9, 2025
1 parent 5fc01d5 commit f858b81
Show file tree
Hide file tree
Showing 5 changed files with 1,044 additions and 8,041 deletions.
18 changes: 2 additions & 16 deletions source/server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,23 +209,9 @@ export default async function createServer(config = defaultConfig) :Promise<expr
app.use("/dist", express.static(config.assets_dir));
}

/* istanbul ignore next */
if(config.hot_reload){
console.log("Hot reload enabled");
const {default: webpack} = await import("webpack");
const {default: middleware} = await import("webpack-dev-middleware");
//@ts-ignore
const {default: configGenerator} = await import("../../ui/webpack.config.js");

const compiler = webpack(configGenerator());
const webpackInstance = middleware(compiler as any, {});
app.use("/dist", webpackInstance);
await new Promise(resolve=> webpackInstance.waitUntilValid(resolve));
}else{
// static file server
app.use("/dist", express.static(config.dist_dir));
// static file server
app.use("/dist", express.static(config.dist_dir));

}


//Privilege-protected routes
Expand Down
2 changes: 1 addition & 1 deletion source/server/tests-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ global.createIntegrationContext = async function(c :Mocha.Context, config_overri
c.dir = await fs.mkdtemp(path.join(tmpdir(), titleSlug));
c.config = Object.assign(
parse({ //Common options
ROOT_DIR: c.dir, CLEAN_DATABASE: "false", VERBOSE: "false", HOT_RELOAD: "false",
ROOT_DIR: c.dir, CLEAN_DATABASE: "false", VERBOSE: "false",
}),
//Options we might want to customize
config_override
Expand Down
1 change: 0 additions & 1 deletion source/server/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const values = {
assets_dir: [undefined, toPath],
trust_proxy: [true, toBool],
hostname: [hostname(), toString],
hot_reload:[false, toBool],
smart_host: ["smtp://localhost", toString],
verbose: [false, toBool],
build_ref: ["unknown", toString],
Expand Down
Loading

0 comments on commit f858b81

Please sign in to comment.