mirror of
https://github.com/iib0011/omni-tools.git
synced 2026-11-20 21:23:09 +03:00
29 lines
838 B
TypeScript
29 lines
838 B
TypeScript
/// <reference types="vitest" />
|
|
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react-swc';
|
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
import packageJson from './package.json';
|
|
import { execSync } from 'node:child_process';
|
|
|
|
const commitHash = execSync('git rev-parse --short HEAD').toString().trim();
|
|
|
|
// https://vitejs.dev/config https://vitest.dev/config
|
|
export default defineConfig({
|
|
plugins: [react(), tsconfigPaths()],
|
|
define: {
|
|
'process.env': {},
|
|
__APP_VERSION__: JSON.stringify(packageJson.version),
|
|
__COMMIT_HASH__: JSON.stringify(commitHash)
|
|
},
|
|
optimizeDeps: {
|
|
exclude: ['@ffmpeg/ffmpeg', '@ffmpeg/util']
|
|
},
|
|
test: {
|
|
globals: true,
|
|
environment: 'happy-dom',
|
|
setupFiles: '.vitest/setup',
|
|
include: ['**/*.test.{ts,tsx}']
|
|
},
|
|
worker: { format: 'es' }
|
|
});
|