Export React as one inline HTML file

I am making one-page websites for particular service that accepts only single inline html files. I want to make these webpages as modularly as possible (to make many versions of them) and am thus using React to have ready components. I need to export the final React code to single inline static html-file. Images should be Base64 strings and css+javascript should be inline in the html.

The output should be:

dist
- index.html

How do I do this with React? Can I use Next.js or Vite?

I tried messing with Next.js export options in next.config.tsx and also tried couple of webpack plugins such as html-webpack-plugin with no success. I need some concrete advice on how to setup the export for React.