mirror of
https://github.com/snowball-tools/snowballtools-base.git
synced 2024-12-23 00:57:44 +00:00
26 lines
641 B
TypeScript
26 lines
641 B
TypeScript
import { defineConfig, PluginOption } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import { exec } from 'child_process';
|
|
import { promisify } from 'util';
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()] as PluginOption[],
|
|
resolve: {
|
|
alias: {
|
|
utils: '/src/utils',
|
|
assets: '/src/assets',
|
|
context: '/src/context',
|
|
components: '/src/components',
|
|
pages: '/src/pages',
|
|
types: '/src/types',
|
|
},
|
|
},
|
|
define: {
|
|
'process.env': {},
|
|
__VERSION__: JSON.stringify(
|
|
(await promisify(exec)('git rev-parse --short HEAD')).stdout.trim(),
|
|
),
|
|
},
|
|
});
|