As of v2.2.0 AVA supports a --config CLI flag that lets you load a different configuration file. Currently that file is required to be in the same directory as the package.json file. This is because the configuration may contain glob patterns, Babel options, and require paths that are relative. It's hard to know how to correctly resolve those patterns, options and paths.
We also don't have an official way of extending a configuration. The suggestion is to use object spread, like so:
If the configuration files are in different directories we'll end up with a mix of relative patterns, options and paths.
After discussing in #2185 we've decided to allow configuration files that are not in the same directory as the package.json file, however we'll print a warning when AVA is starting.
The suggested warning is:
Using configuration from ${relate path to configuration file, from project directory}
As of v2.2.0 AVA supports a
--config
CLI flag that lets you load a different configuration file. Currently that file is required to be in the same directory as thepackage.json
file. This is because the configuration may contain glob patterns, Babel options, andrequire
paths that are relative. It's hard to know how to correctly resolve those patterns, options and paths.We also don't have an official way of extending a configuration. The suggestion is to use object spread, like so:
If the configuration files are in different directories we'll end up with a mix of relative patterns, options and paths.
After discussing in #2185 we've decided to allow configuration files that are not in the same directory as the
package.json
file, however we'll print a warning when AVA is starting.The suggested warning is:
This should be displayed like the warnings for experimental features: https://github.com/avajs/ava/blob/7a668a63b19efdd1b6658eda404a1e5f06d9aa17/lib/cli.js#L168