mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Load settingsCheckModule regardless of module type
GitOrigin-RevId: 7afeb6d5bbe6b5db33c8d1a547009980e6e75c53
This commit is contained in:
parent
46317a9b9c
commit
4919172d52
1 changed files with 10 additions and 4 deletions
|
@ -22,15 +22,21 @@ async function modules() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadModulesImpl() {
|
async function loadModulesImpl() {
|
||||||
const settingsCheckModule = Path.join(
|
const settingsCheckModuleCjs = Path.join(
|
||||||
MODULE_BASE_PATH,
|
MODULE_BASE_PATH,
|
||||||
'settings-check',
|
'settings-check',
|
||||||
'index.js'
|
'index.js'
|
||||||
)
|
)
|
||||||
if (fs.existsSync(settingsCheckModule)) {
|
const settingsCheckModuleEsm = Path.join(
|
||||||
await import(settingsCheckModule)
|
MODULE_BASE_PATH,
|
||||||
|
'settings-check',
|
||||||
|
'index.mjs'
|
||||||
|
)
|
||||||
|
if (fs.existsSync(settingsCheckModuleCjs)) {
|
||||||
|
await import(settingsCheckModuleCjs)
|
||||||
|
} else if (fs.existsSync(settingsCheckModuleEsm)) {
|
||||||
|
await import(settingsCheckModuleEsm)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const moduleName of Settings.moduleImportSequence || []) {
|
for (const moduleName of Settings.moduleImportSequence || []) {
|
||||||
let path
|
let path
|
||||||
if (fs.existsSync(Path.join(MODULE_BASE_PATH, moduleName, 'index.mjs'))) {
|
if (fs.existsSync(Path.join(MODULE_BASE_PATH, moduleName, 'index.mjs'))) {
|
||||||
|
|
Loading…
Reference in a new issue