mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-25 22:22:07 +00:00
e08b0b3d9e
[web] sync overleafModuleImports between environments and check in CI GitOrigin-RevId: c36c41d87d1b6fd687942bca8284a4725bb6c300
26 lines
819 B
JavaScript
26 lines
819 B
JavaScript
function getOverleafModuleImports(settings) {
|
|
return Object.keys(settings.overleafModuleImports).sort().join(',')
|
|
}
|
|
|
|
const CE_CONFIG = require('../config/settings.defaults')
|
|
const PRO_CONFIG = require('../config/settings.overrides.server-pro')
|
|
const SAAS_CONFIG = require('../config/settings.webpack')
|
|
|
|
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()
|