Skip to content

Commit

Permalink
feat: add .cjs config file (#717)
Browse files Browse the repository at this point in the history
Co-authored-by: Benjamin E. Coe <bencoe@google.com>
  • Loading branch information
shirotech and bcoe authored Dec 31, 2021
1 parent 366a498 commit eceaedf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const { readFileSync } = require('fs')

const CONFIGURATION_FILES = [
'.versionrc',
'.versionrc.cjs',
'.versionrc.json',
'.versionrc.js'
]
Expand All @@ -14,7 +15,8 @@ module.exports.getConfiguration = function () {
if (!configPath) {
return config
}
if (path.extname(configPath) === '.js') {
const ext = path.extname(configPath)
if (ext === '.js' || ext === '.cjs') {
const jsConfiguration = require(configPath)
if (typeof jsConfiguration === 'function') {
config = jsConfiguration()
Expand Down

0 comments on commit eceaedf

Please sign in to comment.