mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-05 05:07:14 +02:00
14 lines
391 B
JavaScript
14 lines
391 B
JavaScript
const fs = require('fs-extra');
|
|
const path = require('path');
|
|
|
|
module.exports = function loadConfig(sourceDir, deleteCache = true) {
|
|
const configPath = path.resolve(sourceDir, '.blogi', 'config.js');
|
|
if (deleteCache) {
|
|
delete require.cache[configPath];
|
|
}
|
|
let config = {};
|
|
if (fs.existsSync(configPath)) {
|
|
config = require(configPath);
|
|
}
|
|
return config;
|
|
};
|