返回 slidev
env.ts
根目录 / packages / client / env.ts
1 import { objectMap } from '@antfu/utils'
2 import { computed } from 'vue'
3 import configs from '#slidev/configs'
4
5 export { configs }
6
7 export const mode = import.meta.env.DEV ? 'dev' : 'build'
8
9 export const slideAspect = computed(() => configs.aspectRatio)
10 export const slideWidth = computed(() => configs.canvasWidth)
11
12 // To honor the aspect ratio more as possible, we need to approximate the height to the next integer.
13 // Doing this, we will prevent on print, to create an additional empty white page after each page.
14 export const slideHeight = computed(() => Math.ceil(slideWidth.value / slideAspect.value))
15
16 export const themeVars = computed(() => {
17 return objectMap(configs.themeConfig || {}, (k, v) => [`--slidev-theme-${k}`, v])
18 })
19
20 export const slidesTitle = configs.slidesTitle
21
22 export const pathPrefix = import.meta.env.BASE_URL + (__SLIDEV_HASH_ROUTE__ ? '#/' : '')
23
23 lines TYPESCRIPT