UXP Toolkit
    Preparing search index...

    Options for the UXP pool.

    interface UxpPoolOptions {
        connectionTimeout?: number;
        debug?: boolean;
        embedSourcemap?: boolean;
        enableErrorSourcemapping?: boolean;
        esbuildOptions?: PoolEsbuildOptions;
        executionContextOrSession?: (
            cdp: Client,
        ) => Promise<ExecutionContextOrSession>;
        hotkeys?: {
            enabled?: boolean;
            openDevtools?: (connection: CdpConnection) => Promise<void>;
        };
        inspect?: boolean;
        mainDirectory?: string;
        pluginPath?: string;
        reuseConnection?: boolean;
        rpcTimeout?: number;
        runBeforeTests?: (connection: CdpConnection) => Promise<void>;
        showBundledStackTrace?: boolean;
    }

    Hierarchy

    • Omit<CdpPoolOptions, "cdp">
      • UxpPoolOptions
    Index

    Properties

    connectionTimeout?: number

    Timeout in milliseconds for establishing the CDP connection.

    5000
    
    debug?: boolean

    Enable debug logging.

    false
    
    embedSourcemap?: boolean

    Whether to embed the sourcemap as the EVAL_SOURCEMAP global variable in the bundled code. This makes it available to code running in the CDP context for its own use.

    false
    
    enableErrorSourcemapping?: boolean

    Enable error sourcemapping: remaps stack traces, task locations, and error frames from bundled (esbuild output) positions back to original source positions. Also injects //# sourceURL=filepath so V8 attributes eval'd code to the original file.

    true
    
    esbuildOptions?: PoolEsbuildOptions

    Options for esbuild.

    executionContextOrSession?: (cdp: Client) => Promise<ExecutionContextOrSession>

    Optional function to get the execution context or session id. By default, runs Target.setAutoAttach and waits for target to be attached and uses the target's session id.

    hotkeys?: {
        enabled?: boolean;
        openDevtools?: (connection: CdpConnection) => Promise<void>;
    }

    Enable interactive hotkeys in the terminal.

    Currently supports:

    • d: open the current CDP devtools session in Google Chrome.

    Type Declaration

    • Optionalenabled?: boolean

      Whether to enable the hotkeys.

      true
      
    • OptionalopenDevtools?: (connection: CdpConnection) => Promise<void>

      Function to open the devtools session (e.g. in Google Chrome).

      openDevtoolsSessionInChrome
      
    { enabled: true, openDevtools: openDevtoolsSessionInChrome }
    
    inspect?: boolean

    Whether to enable the inspect mode. Defaults to process.env.UXP_INSPECT or false.

    mainDirectory?: string

    This string gets passed as "UXP_MAIN_DIRECTORY" to the test file.

    process.cwd()
    
    pluginPath?: string

    Path to the UXP plugin directory. Defaults to the built-in "Vitest UXP Test Runner" plugin.

    reuseConnection?: boolean

    Whether to reuse the CDP connection between tests, which is useful in watch mode. It relies on explicit Vitest run/watch flags/commands (--run, run, --watch, watch) and falls back to process.env.CI.

    It uses signal-exit to detect when the process is exiting and disconnect the connection.

    detect from explicit run/watch args, else !!process.env.CI
    
    rpcTimeout?: number

    Timeout in milliseconds for RPC calls to the CDP context.

    30000
    
    runBeforeTests?: (connection: CdpConnection) => Promise<void>

    Optional function to run after the CDP connection is established. Useful for waiting for debugger or something.

    showBundledStackTrace?: boolean

    When true and enableErrorSourcemapping is also true, the original (bundled) stack trace is preserved as error.bundledStack alongside the remapped error.stack. Worker runtime frames are kept in the bundled stack (no frame filtering).

    Useful for debugging sourcemap remapping issues.

    false