Skip to content

Allow disabling file watchers for vite-node #5488

@danieldiekmeier

Description

@danieldiekmeier

Clear and concise description of the problem

I have a few .ts scripts that I run on my server. They are scripts that run through and then exit, so I don't need file watching. Of course, it wouldn't matter either way, but I started getting this error when the files in my project increased:

ENOSPC: System limit for number of file watchers reached

My limit was set to the default of 8192. This is already weird, because I only have ~604 files in my project, but whatever.

Suggested solution

I propose a flag like --no-watch that disables file watchers for cases where you don't need them.

Alternative

I'm currently solving this by setting server.watch: null in a dedicated vite-node.config.js to disable the watcher: https://vitejs.dev/config/server-options.html#server-watch

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3-minor-bugAn edge case that only affects very specific usage (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions