Skip to content

allow resolve config file to use loaders #3134

@panva

Description

@panva

The resolveConfigFile function currently restricts the resolved files to .js, .cjs, or .mjs files.

ava/lib/load-config.js

Lines 40 to 42 in 7007f13

if (!configFile.endsWith('.js') && !configFile.endsWith('.cjs') && !configFile.endsWith('.mjs')) {
throw new Error('Config files must have .js, .cjs or .mjs extensions');
}

What I'm hoping to use, without having to patch ava myself, is a .ts file and use a loader pushed on to node through an environment variable like so

export NODE_OPTIONS='--experimental-loader=@esbuild-kit/esm-loader'

The config file in question performs setup and having it typed helps a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions