From a32a9dc9fa1dea6a81fb8ee2dbdf2cbb8dd648a8 Mon Sep 17 00:00:00 2001 From: Van Nguyen Date: Mon, 15 Feb 2021 11:43:01 +1100 Subject: [PATCH] feat: add .cjs config file --- lib/configuration.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/configuration.js b/lib/configuration.js index 4b74b14a9..5b748318c 100644 --- a/lib/configuration.js +++ b/lib/configuration.js @@ -4,6 +4,7 @@ const { readFileSync } = require('fs') const CONFIGURATION_FILES = [ '.versionrc', + '.versionrc.cjs', '.versionrc.json', '.versionrc.js' ] @@ -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()