OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Export React as one inline HTML file

  • Thread starter Thread starter rass3
  • Start date Start date
R

rass3

Guest
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:

Code:
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.

<p>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.</p>
<p>The output should be:</p>
<pre><code>dist
- index.html
</code></pre>
<p>How do I do this with React? Can I use Next.js or Vite?</p>
<p>I tried messing with Next.js export options in next.config.tsx and also tried couple of webpack plugins such as <a href="https://github.com/jantimon/html-webpack-plugin" rel="nofollow noreferrer">html-webpack-plugin</a> with no success. I need some concrete advice on how to setup the export for React.</p>
 
Top