diff --git a/packages/@vuepress/core/lib/node/loadConfig.js b/packages/@vuepress/core/lib/node/loadConfig.js index c786e88d44..ec8b5f8459 100644 --- a/packages/@vuepress/core/lib/node/loadConfig.js +++ b/packages/@vuepress/core/lib/node/loadConfig.js @@ -14,6 +14,7 @@ const tomlParser = require('toml') module.exports = function loadConfig (vuepressDir, bustCache = true) { const configPath = path.resolve(vuepressDir, 'config.js') + const configCjsPath = path.resolve(vuepressDir, 'config.cjs') const configYmlPath = path.resolve(vuepressDir, 'config.yml') const configTomlPath = path.resolve(vuepressDir, 'config.toml') @@ -29,6 +30,8 @@ module.exports = function loadConfig (vuepressDir, bustCache = true) { siteConfig = parseConfig(configTomlPath) } else if (fs.existsSync(configPath)) { siteConfig = require(configPath) + } else if (fs.existsSync(configCjsPath)) { + siteConfig = require(configCjsPath) } return siteConfig