#How to set up live-reload for cached templates in fastify

2 messages · Page 1 of 1 (latest)

astral edge
#

The problem is that I need to manually stop and start the server to any .html template changes get effect
I have tried using the flag --watchAssets for nest start, but it only updates the ./dist folder html file instead of reloading the application
I'm using fastify 3.x with point-of-view for the rendering. Here's my config.

app.useStaticAssets({
    root: `${WORKING_DIR}/src/frontend/public`,
    prefix: "/public/",
});

app.setViewEngine({
    engine: { nunjucks },
    templates: `${WORKING_DIR}/src/frontend/views`,
    viewExt: "html",
    production: !["local", "test"].includes(process.env.NODE_ENV!),
    includeViewExtension: true,
});
#

settings production: false and maxCache: 0 on setViewEngine did not resolve the problem