返回 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
8 ? 'dev'
9 : 'build'
10
11 export const slideAspect = computed(() => configs.aspectRatio)
12 export const slideWidth = computed(() => configs.canvasWidth)
13
14 // To honor the aspect ratio more as possible, we need to approximate the height to the next integer.
15 // Doing this, we will prevent on print, to create an additional empty white page after each page.
16 export const slideHeight = computed(() => Math.ceil(slideWidth.value / slideAspect.value))
17
18 export const themeVars = computed(() => {
19 return objectMap(configs.themeConfig || {}, (k, v) => [`--slidev-theme-${k}`, v])
20 })
21
22 export const slidesTitle = configs.slidesTitle
23
24 export const pathPrefix = import.meta.env.BASE_URL + (__SLIDEV_HASH_ROUTE__ ? '#/' : '')
25
25 lines TYPESCRIPT