0
Fork 0
mirror of https://codeberg.org/SafeTwitch/safetwitch.git synced 2024-12-22 13:22:58 -05:00
safetwitch/vite.config.ts
2023-08-18 14:21:31 -04:00

33 lines
785 B
TypeScript

import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
import { dirname, resolve } from 'node:path'
import { gitDescribeSync } from 'git-describe'
// Footer version
const gitVer = gitDescribeSync()
process.env.SAFETWITCH_COMMIT_HASH = gitVer.hash
process.env.SAFETWITCH_TAG = gitVer.tag!
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
VueI18nPlugin({
include: resolve(dirname(fileURLToPath(import.meta.url)), './src/locales/**'),
})
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
build: {
cssCodeSplit: true
},
envPrefix: 'SAFETWITCH_',
})