totp/vite.config.ts
2025-02-10 12:17:47 -05:00

27 lines
584 B
TypeScript

import {defineConfig} from 'vite';
import react from '@vitejs/plugin-react';
import {nodePolyfills} from 'vite-plugin-node-polyfills';
import svgr from 'vite-plugin-svgr';
function yearPlugin() {
return {
name: 'year',
transformIndexHtml(html: string): string {
return html.replace('__YEAR__', new Date().getFullYear().toString());
},
} as const;
}
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
svgr(),
react(),
yearPlugin(),
nodePolyfills({
include: ['buffer'],
globals: {Buffer: true},
}),
],
});