config.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import deepmerge from 'deepmerge'
  2. import { buildConfig } from '@/functions'
  3. const getMixinConfig = () => import('@/mixins/ExperimentBaseAreSameImages/config')
  4. const getGlobalConfig = () => import('@/../experimentConfig/Experiments/AreSameImagesReference')
  5. // This will apply to all the scenes
  6. export const defaultConfig = async () => {
  7. // Import parent mixin config
  8. const mixinConfig = await getMixinConfig().then(({ defaultConfig: fn }) => fn())
  9. // Import global config
  10. const globalConfig = (await getGlobalConfig()).defaultConfig
  11. return deepmerge.all([
  12. mixinConfig,
  13. {},
  14. globalConfig
  15. ])
  16. }
  17. // This will overwrite the config for the given scene
  18. export const scenesConfig = async () => {
  19. // Import parent mixin config
  20. const mixinConfig = await getMixinConfig().then(({ scenesConfig: fn }) => fn())
  21. // Import global config
  22. const globalConfig = (await getGlobalConfig()).scenesConfig
  23. return deepmerge.all([
  24. mixinConfig,
  25. {},
  26. globalConfig
  27. ])
  28. }
  29. export default async () => buildConfig(await defaultConfig(), await scenesConfig())