KC's Workspace
    Preparing search index...
    interface WatcherOptions {
        buildDelay?: number;
        clearScreen?: boolean;
        exclude?: string | RegExp | (string | RegExp)[];
        include?: string | RegExp | (string | RegExp)[];
        notify?: WatcherFileWatcherOptions;
        onInvalidate?: (id: string) => void;
        skipWrite?: boolean;
        watcher?: WatcherFileWatcherOptions;
    }
    Index

    Properties

    buildDelay?: number

    Configures how long Rolldown will wait for further changes until it triggers a rebuild in milliseconds.

    Even if this value is set to 0, there's a small debounce timeout configured in the file system watcher. Setting this to a value greater than 0 will mean that Rolldown will only trigger a rebuild if there was no change for the configured number of milliseconds. If several configurations are watched, Rolldown will use the largest configured build delay.

    This option is useful if you use a tool that regenerates multiple source files very slowly. Rebuilding immediately after the first change could cause Rolldown to generate a broken intermediate build before generating a successful final build, which can be confusing and distracting.

    0
    
    clearScreen?: boolean

    Whether to clear the screen when a rebuild is triggered.

    true
    
    exclude?: string | RegExp | (string | RegExp)[]

    Filter to prevent files from being watched.

    Strings are treated as glob patterns.

    export default defineConfig({
    watch: {
    exclude: 'node_modules/**',
    },
    })
    []
    
    include?: string | RegExp | (string | RegExp)[]

    Filter to limit the file-watching to certain files.

    Strings are treated as glob patterns. Note that this only filters the module graph but does not allow adding additional watch files.

    export default defineConfig({
    watch: {
    include: 'src/**',
    },
    })
    []
    

    Use watcher instead.

    onInvalidate?: (id: string) => void

    An optional function that will be called immediately every time a module changes that is part of the build.

    This is different from the watchChange plugin hook, which is only called once the running build has finished. This may for instance be used to prevent additional steps from being performed if we know another build will be started anyway once the current build finished. This callback may be called multiple times per build as it tracks every change.

    Type Declaration

      • (id: string): void
      • Parameters

        • id: string

          The id of the changed module.

        Returns void

    skipWrite?: boolean

    Whether to skip the RolldownBuild.write | bundle.write() step when a rebuild is triggered.

    false
    

    File watcher options for configuring how file changes are detected.