除非重新启动服务器,否则 denjucks 模板中的更改不会反映在刷新中

Changes in denjucks templates not reflected on refresh unless server is restarted

我正在使用 'deno' 和 'oak'。对于自动刷新,我使用 'denon' 类似于 nodejs 中的 'nodemon' 。作为模板引擎,第三方模块,我正在使用 - 'denjucks'。每当我对模板代码进行任何更改并保存时,服务器都不会自动重启。如何解决这个问题?

您可以使用 exts 选项并添加 html

{
  "scripts": { /* */ },

  "watcher": {
    // The number of milliseconds after the last change.
    "interval": 350,
    // The file extensions that it will scan for.
    "exts": ["js", "ts", "json", "html"],
    // The globs that it will scan for.
    "match": ["*.*"],
    // The globs that it will not scan for.
    "skip": ["*/.git/*"],
    // Use the legacy file monitoring algorithm. (walking)
    "legacy": false
  }
}

问题已解决。在 denon.json 文件中添加了以下 -

"watcher": {   
       "exts": ["js", "ts", "json", "html"]
}

这会在观察者列表中添加 html 文件。