From f19809d294b7f715d0379cd87a618eae8d4a65d5 Mon Sep 17 00:00:00 2001 From: Sebastien DUMETZ Date: Fri, 5 Jan 2024 13:07:24 +0100 Subject: [PATCH] change assets paths and include new build into server hot reload --- source/server/server.ts | 12 +++++++----- source/server/templates/explorer.hbs | 4 ++-- source/server/templates/home.hbs | 2 +- source/server/templates/layouts/main.hbs | 4 ++-- source/server/templates/story.hbs | 6 +++--- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/source/server/server.ts b/source/server/server.ts index 27c7b5d5..1e72722d 100644 --- a/source/server/server.ts +++ b/source/server/server.ts @@ -166,16 +166,18 @@ export default async function createServer(config = defaultConfig) :Promise webpackInstance.waitUntilValid(resolve)); }else{ // static file server - app.use("/", express.static(config.dist_dir)); + app.use("/dist", express.static(config.dist_dir)); + } - app.use("/", express.static(config.assets_dir)); + app.use("/libs", (await import("./routes/libs/index.js")).default); diff --git a/source/server/templates/explorer.hbs b/source/server/templates/explorer.hbs index 41c1f022..8455e2e1 100644 --- a/source/server/templates/explorer.hbs +++ b/source/server/templates/explorer.hbs @@ -1,3 +1,3 @@ - - + + diff --git a/source/server/templates/home.hbs b/source/server/templates/home.hbs index 76e3bf6a..84ac80cd 100644 --- a/source/server/templates/home.hbs +++ b/source/server/templates/home.hbs @@ -1,3 +1,3 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/source/server/templates/layouts/main.hbs b/source/server/templates/layouts/main.hbs index 4d2d47dd..187fb708 100644 --- a/source/server/templates/layouts/main.hbs +++ b/source/server/templates/layouts/main.hbs @@ -16,12 +16,12 @@ {{title}} - + - + diff --git a/source/server/templates/story.hbs b/source/server/templates/story.hbs index 56fb11da..0368a21b 100644 --- a/source/server/templates/story.hbs +++ b/source/server/templates/story.hbs @@ -1,4 +1,4 @@ - - - \ No newline at end of file + + + \ No newline at end of file