config.js 726 B

123456789101112131415161718192021222324252627
  1. import deepmerge from 'deepmerge'
  2. import { buildConfig } from '@/functions'
  3. // const getMixinConfig = () => {}
  4. const getGlobalConfig = () => import('@/../experimentConfig/mixins/ExperimentBase')
  5. // This will apply to all the scenes
  6. export const defaultConfig = async () => {
  7. const globalConfig = (await getGlobalConfig()).defaultConfig
  8. return deepmerge.all([
  9. {
  10. lockConfig: true
  11. },
  12. globalConfig
  13. ])
  14. }
  15. // This will overwrite the config for the given scene
  16. export const scenesConfig = async () => {
  17. const globalConfig = (await getGlobalConfig()).scenesConfig
  18. return deepmerge.all([
  19. {},
  20. globalConfig
  21. ])
  22. }
  23. export default async () => buildConfig(await defaultConfig(), await scenesConfig())