2024-10-18 07:04:57 -04:00
|
|
|
import CE_CONFIG from '../config/settings.defaults.js'
|
|
|
|
import PRO_CONFIG from '../config/settings.overrides.server-pro.js'
|
|
|
|
import SAAS_CONFIG from '../config/settings.webpack.js'
|
|
|
|
|
2024-07-31 04:03:30 -04:00
|
|
|
function getOverleafModuleImports(settings) {
|
|
|
|
return Object.keys(settings.overleafModuleImports).sort().join(',')
|
|
|
|
}
|
|
|
|
|
|
|
|
function main() {
|
|
|
|
const CE = getOverleafModuleImports(CE_CONFIG)
|
|
|
|
const PRO = getOverleafModuleImports(CE_CONFIG.mergeWith(PRO_CONFIG))
|
|
|
|
const SAAS = getOverleafModuleImports(CE_CONFIG.mergeWith(SAAS_CONFIG))
|
|
|
|
|
|
|
|
if (CE !== PRO) {
|
|
|
|
throw new Error(
|
|
|
|
'settings.defaults is missing overleafModuleImports defined in settings.overrides.server-pro'
|
|
|
|
)
|
|
|
|
}
|
|
|
|
if (CE !== SAAS) {
|
|
|
|
throw new Error(
|
|
|
|
'settings.defaults is missing overleafModuleImports defined in settings.webpack'
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
main()
|