mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-14 14:40:55 -05:00
26f3f3e2e2
Migrate scripts folder to esm 1/x GitOrigin-RevId: 4a4bc9a161f144fdb40ce3f2a0a9313b36c6df81
26 lines
813 B
JavaScript
26 lines
813 B
JavaScript
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'
|
|
|
|
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()
|