wxt-dev/wxt

Expose chokidar watch options in `wxt.config.ts` (e.g. for polling in Docker/devcontainer)

Open

#2342 opened on May 9, 2026

View on GitHub
 (1 comment) (0 reactions) (0 assignees)TypeScript (9,861 stars) (511 forks)user submission
contribution welcomegood first issue

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=1 env var — works but is not part of the config file, harder to document and share
  • vite.server.watch — excluded by WXT
  • vite.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 / fsevents are unavailable

Contributor guide