From 226ec4a6c74d9209f097c9bc848c258a771105c9 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..168aac225 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()