mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-10 23:02:56 +02:00
refactor: rename loader to load as not to confuse webpack loader
This commit is contained in:
parent
36eee2941a
commit
9fef99cb18
15 changed files with 4 additions and 131 deletions
14
lib/load/config.js
Normal file
14
lib/load/config.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
const fs = require('fs-extra');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = function loadConfig(siteDir, deleteCache = true) {
|
||||
const configPath = path.resolve(siteDir, 'siteConfig.js');
|
||||
if (deleteCache) {
|
||||
delete require.cache[configPath];
|
||||
}
|
||||
let config = {};
|
||||
if (fs.existsSync(configPath)) {
|
||||
config = require(configPath); // eslint-disable-line
|
||||
}
|
||||
return config;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue