Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/@vuepress/core/lib/node/loadConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand All @@ -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
Expand Down