Skip to content

Commit

Permalink
fix: add an escape hatch for esm config file
Browse files Browse the repository at this point in the history
  • Loading branch information
kien-ht committed Dec 15, 2023
1 parent 8b6e14a commit 6f066bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import DEFAULT_CONFIG from './config.default'

function getUserConfigFile() {
try {
if (fs.existsSync(path.join(process.cwd(), 'cypress-image-diff.config.cjs'))) {
// eslint-disable-next-line import/no-dynamic-require, global-require
return require(path.join(process.cwd(), 'cypress-image-diff.config.cjs'))
}
// eslint-disable-next-line import/no-dynamic-require, global-require
return require(path.join(process.cwd(), 'cypress-image-diff.config'))
} catch (err) {
Expand Down

0 comments on commit 6f066bd

Please sign in to comment.