KC's Workspace
    Preparing search index...
    interface DepsOptions {
        interopDefault?: boolean;
        moduleDirectories?: string[];
        optimizer?: Partial<
            Record<"client" | "ssr" | {} & string, DepsOptimizationOptions>,
        >;
        web?: {
            transformAssets?: boolean;
            transformCss?: boolean;
            transformGlobPattern?: RegExp | RegExp[];
        };
    }
    Index

    Properties

    interopDefault?: boolean

    Interpret CJS module's default as named exports

    true
    
    moduleDirectories?: string[]

    A list of directories relative to the config file that should be treated as module directories.

    ['node_modules']
    
    optimizer?: Partial<
        Record<"client" | "ssr" | {} & string, DepsOptimizationOptions>,
    >

    Enable dependency optimization. This can improve the performance of your tests.

    web?: {
        transformAssets?: boolean;
        transformCss?: boolean;
        transformGlobPattern?: RegExp | RegExp[];
    }

    Type Declaration

    • OptionaltransformAssets?: boolean

      Should Vitest process assets (.png, .svg, .jpg, etc) files and resolve them like Vite does in the browser.

      These module will have a default export equal to the path to the asset, if no query is specified.

      At the moment, this option only works with { pool: 'vmThreads' }.

      true
      
    • OptionaltransformCss?: boolean

      Should Vitest process CSS (.css, .scss, .sass, etc) files and resolve them like Vite does in the browser.

      If CSS files are disabled with css options, this option will just silence UNKNOWN_EXTENSION errors.

      At the moment, this option only works with { pool: 'vmThreads' }.

      true
      
    • OptionaltransformGlobPattern?: RegExp | RegExp[]

      Regexp pattern to match external files that should be transformed.

      By default, files inside node_modules are externalized and not transformed.

      At the moment, this option only works with { pool: 'vmThreads' }.

      []