Skip to content

feat(wxt): expose file watcher options#2398

Open
myjeong19 wants to merge 1 commit into
wxt-dev:mainfrom
myjeong19:feat/watch-options
Open

feat(wxt): expose file watcher options#2398
myjeong19 wants to merge 1 commit into
wxt-dev:mainfrom
myjeong19:feat/watch-options

Conversation

@myjeong19

@myjeong19 myjeong19 commented May 30, 2026

Copy link
Copy Markdown

Overview

Adds a watchOptions config option to wxt.config.ts so users can configure file watching behavior.

This is intended for environments where native file events may not be delivered reliably, such as Docker, devcontainers, WSL mounts, or network filesystems. In those cases, users can opt into polling with watchOptions: { usePolling: true } instead of relying on CHOKIDAR_USEPOLLING=1.

The options are forwarded to Vite's dev server watcher while preserving WXT's default ignored paths.

Manual Testing

Run the dev server e2e test

bun run --filter wxt test -- --run e2e/tests/dev.test.ts

This verifies that watchOptions is forwarded to Vite's dev server watcher while preserving usePolling, interval, WXT's default ignored paths, existing vite.server.watch, and custom ignored entries.

Docker & Dev Container manual checks

To manually verify the behavior, run a WXT project with:

export default defineConfig({
  watchOptions: {
    usePolling: true,
    interval: 1000,
  },
});

inside a Docker container or devcontainer, edit a mounted source file from inside the same container, and confirm that WXT logs the change and reloads the extension.

I also tested this branch in both a Docker container and a VS Code devcontainer with packages/wxt-demo using a temporary watchOptions: { usePolling: true, interval: 1000 } config. Editing an entrypoint file from inside the same container triggered reload in both cases.

Related Issue

This PR closes #2342

@myjeong19 myjeong19 requested a review from aklinker1 as a code owner May 30, 2026 17:59
@netlify

netlify Bot commented May 30, 2026

Copy link
Copy Markdown

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit bb1a577
🔍 Latest deploy log https://app.netlify.com/projects/creative-fairy-df92c4/deploys/6a1b258e3354d9000801eed5
😎 Deploy Preview https://deploy-preview-2398--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the pkg/wxt Includes changes to the `packages/wxt` directory label May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg/wxt Includes changes to the `packages/wxt` directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant