【问题标题】:glitch.com watch file not working properlyglitch.com 监视文件无法正常工作
【发布时间】:2021-12-02 04:39:19
【问题描述】:

我正在 glitch.com 上创建一个 watch.json 文件,遵循以下说明:https://glitch.happyfox.com/kb/article/60-can-i-change-which-files-cause-my-app-to-restart/

我的目标是在每次编辑 JS 或 CSS 文件后自动重启浏览器页面。或者当它这样做时,它应该在 50 秒后才重新加载。

{
  "install": {
    "include": [
      "^package\\.json$",
      "^\\.env$"
    ]
  },
  "restart": {
    "exclude": [
      "^public/",
      "^dist/",
      "\\.js$",
      "\\.md$",
      "\\.html$",
      "\\.css$"
    ],
    "include": [
      "\\watch.json"
    ]
  },
  "throttle": 50000
}

遗憾的是,这似乎不起作用。 JS 或 CSS 文件的任何更改都会立即导致重新加载。有什么问题?

故障项目在这里:https://glitch.com/edit/#!/ml5test-two

【问题讨论】:

    标签: json watch glitch-framework


    【解决方案1】:

    watch.json 文件指的是全栈应用的构建/重启时间,而不是浏览器窗口刷新。您可以在编辑器的项目菜单中关闭“在更改时刷新应用程序”。见:https://help.glitch.com/kb/article/46-can-i-turn-off-or-on-automatic-refreshing-of-the-app-preview-when-i-make-changes/

    【讨论】:

    • 哇,谢谢,不知道我是怎么错过的。
    猜你喜欢
    • 2023-03-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-06
    • 2014-01-09
    • 2016-04-01
    • 1970-01-01
    • 2016-05-05
    相关资源
    最近更新 更多