我正在使用 Laravel 10 以及 Inertia 和 Vite。该/resources/stuff/
文件夹包含大量子文件夹和文件,我不想在运行 Vite 时看到这些子文件夹和文件。这是为了避免得到“ ENOSPC: System limit for number of file watchers reached
”。
我的 vite.config.js 包含以下选项:
export default defineConfig({
server: {
watch: {
ignored: ["/resources/stuff/"],
},
},
...
});
然而,当我这样做时npm run dev
,我仍然会ENOSPC: System limit for number of file watchers reached
在被忽略的文件夹中找到一个文件。
如何让 Vite/resources/stuff/
在监视文件更改时跳过?我使用的是 Ubuntu 22.04。我不想只增加操作系统的最大文件观察器数量,因为该文件夹包含超过 80,000 个文件。
我猜你的路径不正确。
/resources
会引用文件系统根目录中的绝对路径,不是吗?看来这会是一个更好的搭配