first in your vite-env.d.ts
file, put the following line to let typescript treat .md files as a module.
declare module '*.md';
then in your vite.config.ts
file put the following code to create a custom plugin which loads .md files and gets the raw content of the .md file
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';