totp/vite.config.ts

27 lines
584 B
TypeScript
Raw Normal View History

2024-04-06 22:54:44 -04:00
import {defineConfig} from 'vite';
import react from '@vitejs/plugin-react';
2024-04-07 00:13:19 -04:00
import {nodePolyfills} from 'vite-plugin-node-polyfills';
2024-04-07 03:03:48 -04:00
import svgr from 'vite-plugin-svgr';
2024-04-06 22:54:44 -04:00
2025-02-10 12:17:47 -05:00
function yearPlugin() {
return {
name: 'year',
transformIndexHtml(html: string): string {
return html.replace('__YEAR__', new Date().getFullYear().toString());
},
} as const;
}
2024-04-06 22:54:44 -04:00
// https://vitejs.dev/config/
export default defineConfig({
2024-04-07 00:13:19 -04:00
plugins: [
2024-04-07 03:03:48 -04:00
svgr(),
2024-04-07 00:13:19 -04:00
react(),
2025-02-10 12:17:47 -05:00
yearPlugin(),
2024-04-07 00:13:19 -04:00
nodePolyfills({
include: ['buffer'],
globals: {Buffer: true},
}),
],
2024-04-06 22:54:44 -04:00
});