2024-05-17 00:42:29 +00:00
|
|
|
import { defineConfig, PluginOption } from 'vite';
|
2024-04-24 17:18:59 +00:00
|
|
|
import react from '@vitejs/plugin-react';
|
2024-06-04 17:03:22 +00:00
|
|
|
import { exec } from 'child_process';
|
|
|
|
import { promisify } from 'util';
|
2024-04-11 21:40:22 +00:00
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
2024-05-17 00:42:29 +00:00
|
|
|
plugins: [react()] as PluginOption[],
|
2024-04-11 21:40:22 +00:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
2024-04-24 17:18:59 +00:00
|
|
|
utils: '/src/utils',
|
|
|
|
assets: '/src/assets',
|
|
|
|
context: '/src/context',
|
|
|
|
components: '/src/components',
|
2024-05-14 17:07:32 +00:00
|
|
|
pages: '/src/pages',
|
|
|
|
types: '/src/types',
|
2024-04-11 21:40:22 +00:00
|
|
|
},
|
|
|
|
},
|
2024-04-24 17:18:18 +00:00
|
|
|
define: {
|
2024-04-25 00:02:52 +00:00
|
|
|
'process.env': {},
|
2024-06-04 17:03:22 +00:00
|
|
|
__VERSION__: JSON.stringify(
|
|
|
|
(await promisify(exec)('git rev-parse --short HEAD')).stdout.trim(),
|
|
|
|
),
|
2024-04-24 17:18:18 +00:00
|
|
|
},
|
2024-04-11 21:40:22 +00:00
|
|
|
});
|