Expose chokidar watch options in `wxt.config.ts` (e.g. for polling in Docker/devcontainer)
#2342 opened on May 9, 2026
Description
Feature Request
Summary
Add support for configuring chokidar watch options (e.g. usePolling, interval)
via wxt.config.ts, so users can control file watching behavior without relying on
environment variables.
Motivation
When developing inside Docker containers or VS Code devcontainers, the file system
does not emit native OS events. This means WXT's file watcher (backed by chokidar)
never detects changes, effectively breaking wxt dev.
The only current workaround is to set chokidar's environment variables before running:
CHOKIDAR_USEPOLLING=1 wxt dev
While this works, it's undocumented, easy to forget, and harder to share across a
team (e.g. in package.json scripts it requires platform-specific handling or
cross-env).
Proposed API
Expose a watchOptions field in InlineConfig that passes options directly to
chokidar:
// wxt.config.ts
export default defineConfig({
watchOptions: {
usePolling: true,
interval: 1000,
},
});
Alternatives Considered
CHOKIDAR_USEPOLLING=1env var — works but is not part of the config file, harder to document and sharevite.server.watch— excluded by WXTvite.build.watch— explicitly blocked by WXT with an error
Use Cases
- Docker / devcontainer development
- WSL1 / WSL2 (cross-filesystem mounts like
/mnt/c/...) - NFS or other network file systems
- Any environment where
inotify/fseventsare unavailable