How to export a Lovable project as HTML

Lovable gives you a React project, not an HTML file. One build setting turns that project into a single index.html you can open, send, or put at a link.

In short

Lovable has no "export as HTML" button. You get source code instead, through GitHub sync on any plan or Download codebase on a paid plan.

That code must be built. A normal build gives an index.html plus separate JavaScript and CSS files, and the index.html alone opens as a blank page.

Add the vite-plugin-singlefile plugin and build again. You get one index.html with everything inside, and that file works on its own: open it, send it, or put it at a link.

Check first: new Lovable projects use TanStack Start since May 13, 2026. These steps were tested on a React + Vite project.

We wanted to see every step between a Lovable-style project and a link you can send. We did not use a Lovable account for this. Instead we built a small fictional landing page for a pottery studio with React and Vite, the stack behind Lovable's older projects, plus Tailwind for styling. We built it the normal way, saw it fail, built it again as one file, put it on NOS, changed the start date on the NOS screen, and reopened the same link.

Can I export Lovable code?

You can, but only as source code. Lovable's docs describe two ways to get the whole project:

  • GitHub sync. Connect the project to GitHub and Lovable creates a new private repository with your code. On GitHub, choose Code, then Download ZIP. Lovable lists GitHub sync on all plans.
  • Download codebase. In the code editor, the button sits at the bottom of the file panel. It is also under Project settings, then Git. This one is for paid plans.

There is also a Download button for a single file, on any plan. It saves one source file, not a working page.

Either way, you get a project folder, not a page. It has a package.json, a src folder, and a Vite config file. The index.html in that folder is a shell that points at the source files. The page only exists after a build.

Can I download Lovable code without GitHub?

Only on a paid plan, with Download codebase. On the Free plan, GitHub is the official way out. You need a free GitHub account, but you never have to use Git itself: connect, open the new repository, and download the ZIP.

Why the normal build gives you a blank page

We ran a standard Vite build on the pottery page. It produced three files: an index.html of under 1 KB, a JavaScript file of 146 KB, and a CSS file of 12 KB in an assets folder. The index.html holds almost nothing. It only tells the browser to load the other two files from a path that starts with a slash.

We opened that index.html on its own. The tab showed the right title, but the page had no visible text at all. That is what happens if you upload or send only the HTML file: the browser cannot find the files that draw the page.

A web host that takes the whole folder fixes this. A tool that takes one HTML file needs everything inside that file.

How do I export Lovable to HTML as one file?

You need Node.js on your computer (the LTS version from nodejs.org) and a terminal open in the unzipped project folder. Then:

  1. Install the project's packages: npm install
  2. Add the plugin: npm install -D vite-plugin-singlefile
  3. Open the Vite config file (vite.config.ts or vite.config.js). Keep the plugins that are already there and add the new one to the end of the list. We also set the base path to "./" so nothing points at the root of a domain.
  4. Build: npm run build
  5. Open the dist folder. You should see one index.html and no assets folder of JavaScript files. Open it with a double-click; the page should look the same as in Lovable.

The change to the config file is three small edits:

import { viteSingleFile } from "vite-plugin-singlefile";

export default defineConfig({ base: "./", plugins: [/* existing plugins */, viteSingleFile()], });

Our rebuilt pottery page came out as one index.html of 160 KB. Opened on its own, it showed the full page: heading, class times, and the question list.

Three things to check before you share the file:

  • Upload the file from dist, not the index.html at the top of the project. The top one is the empty shell.
  • Look at every image. The plugin's README says files in the public folder are not pulled into the HTML. Images there need a full https address or they will be missing.
  • Multi-page apps need hash links. The README says routing that uses browser history does not work in a single file, but hash-based routing does. If your app has several pages, ask Lovable to switch to hash routes (addresses like /#/pricing) before you export.

Once you have one working HTML file, any host that accepts a single file will do. We used NOS. We pasted the built file into a new page. The Code view shows the whole app as one long block: the React code is minified and sits inside the HTML, so you do not need to read it.

NOS Code view showing the built pottery page as one HTML file with minified code inline
1. The built file in the NOS Code view. Everything the page needs is inside this one file.
Fictional Juniper Hall Pottery Studio landing page in the NOS View mode, showing courses start March 3
2. View mode runs the React page. The start date reads March 3.

Then we opened Share and copied the link. The panel says anyone with the link can read the page without signing in and cannot edit it. Search indexing was off, and "Public on the web" was not checked.

NOS Share panel for the fictional pottery page with the read-only link
3. The Share panel creates a read-only link.
The shared link opened at phone width, showing the pottery page with the March 3 start date
4. The shared link at phone width, before the change.

Say the course start moves a week. In NOS we chose Edit, clicked the date sentence, typed "Six-week courses start March 10.", and chose Done.

NOS Edit mode with the start date sentence changed to March 10 and the Done button visible
5. Edit mode: click the text, type, then choose Done.
NOS View mode after saving, with the start date reading March 10
6. After Done, View shows the new date.

This is worth a closer look, because the sentence is not plain HTML. In a React build it lives inside the JavaScript. We checked the saved file: "March 3" was gone and "March 10" sat in the same spot inside the code. Then we opened the original link again. It showed the new date, and the question list still opened when clicked, so the React part kept working.

The same shared link reopened, now showing courses start March 10
7. The same link, reopened after the edit.
Question list on the edited shared page with one answer opened after a click
8. The interactive question list still works after the text change.

Two limits from this test. It worked for a sentence that sits in the code as one plain piece of text. We did not test text the app builds from several values, or text loaded from a database. Also, the fix lives only in the NOS copy. Your Lovable project still says the old thing, so make the same change in Lovable too. Otherwise the next export brings the old date back.

You can download the built pottery page (the March 3 version) to see what a single-file React build looks like inside.

When not to do this

Skip the single file and use Lovable's own Publish when the app needs login, saved data, payments, or server functions. A static file cannot run a server. Lovable publishes to a lovable.app address on all plans, and custom domains need a paid plan.

Skip it, too, if you still change the app in Lovable every day. Each change means a new build and a new upload, while Publish updates from where you work.

If your project uses TanStack Start, check its build output first. We did not test those projects, and any part that runs on a server will not exist in a static file. Finally, the plugin's own README warns that one big file is a poor fit for a normal website's speed. Use it for a landing page, a demo, or a prototype you want to send, not a large site.

Where NOS fits

NOS gives one self-contained HTML file a read-only link. In this test, the built React page ran inside NOS, Edit changed a sentence without a rebuild, and the original link showed the update. It does not run a back end, host a multi-file folder, or keep your Lovable project in sync. The Free plan allows three share links at once; see the pricing page for current plans.

If the file still breaks somewhere, the self-contained HTML file checklist covers outside links that a single file can still depend on. If you would rather upload the full dist folder to a regular host, hosting a built front end explains the base path and refresh errors. For quick text changes without opening the code, see editing HTML without coding.

Questions people ask

Does Lovable have an export to HTML button?

There isn't one. Lovable's docs list GitHub sync, Download codebase, and a single-file download. All three give you source code. To get a working HTML file, build the project, and add the single-file plugin if you want one file instead of a folder.

Can I get my Lovable code on the Free plan?

Yes, through GitHub sync, which Lovable lists on all plans. Download codebase, the direct ZIP, is for paid plans.

Will a change I make on NOS show up in my Lovable project?

It will not. NOS changes only its own copy of the HTML file. Make the same change in Lovable, or the next build will bring the old text back.

Is one big HTML file slower than the normal build?

It is one larger file instead of several smaller ones. Our example was 160 KB as one file. The plugin's README says this is a poor choice for a normal website's speed, so keep it for landing pages, demos, and prototypes.

Keep reading