Skip to content

Commit eceaedf

Browse files
shirotechbcoe
andauthored
feat: add .cjs config file (#717)
Co-authored-by: Benjamin E. Coe <[email protected]>
1 parent 366a498 commit eceaedf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/configuration.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const { readFileSync } = require('fs')
44

55
const CONFIGURATION_FILES = [
66
'.versionrc',
7+
'.versionrc.cjs',
78
'.versionrc.json',
89
'.versionrc.js'
910
]
@@ -14,7 +15,8 @@ module.exports.getConfiguration = function () {
1415
if (!configPath) {
1516
return config
1617
}
17-
if (path.extname(configPath) === '.js') {
18+
const ext = path.extname(configPath)
19+
if (ext === '.js' || ext === '.cjs') {
1820
const jsConfiguration = require(configPath)
1921
if (typeof jsConfiguration === 'function') {
2022
config = jsConfiguration()

0 commit comments

Comments
 (0)