code-coverage icon indicating copy to clipboard operation
code-coverage copied to clipboard

support CJS configs in ES packages

Open quisido opened this issue 3 years ago • 0 comments

Problem statement

When writing an application with "type": "module" in package.json, it becomes impossible to set the NYC config with JS, since it only supports the .js extension and it only supports CommonJS. As a result, any configuration in nyc.config.js will fail for trying to require an ES module.

This PR adds support for nyc.config.cjs, allowing packages with "type": "module" to still configure a nyc.config.cjs file for a CommonJS configuration.

quisido avatar Feb 23 '22 21:02 quisido