04 Build notes Lovable-Eject
How I built Lovable-Eject
April 2026 3 min read by ABS Astreon
I wrote Lovable-Eject the third time I had to spend an afternoon hand-editing config files to get a Lovable project hosted somewhere that wasn't Lovable. After that, I had a small enough script that I figured I'd just publish it.
Lovable is a nice prototyping tool. Once you've got a project with real users or a custom domain, the hosting starts to feel like a fence. You can export the code, but what comes out the other side isn't quite a project. There are leftover config files referencing services you no longer use. There are import paths assuming a runtime specific to their hosting. There's a package.json shaped slightly wrong for any other host's expectations. None of it is hard to fix. All of it is annoying.
What it actually does
You run npx lovable-eject in your exported project. The script removes the Lovable-specific config, normalises the project structure, preserves your environment variables (and writes a .env.example for collaborators), and gives you back something you can git push to Vercel, Netlify, Cloudflare Pages, Railway, or any Node host. Roughly thirty seconds of work instead of an afternoon.
Why npx, no install
I made it npx-only deliberately. You only need this tool once or twice in the life of a project. Eject, host, done. A global install is overhead for that. Locking it into a package.json dev dependency is worse, because then it sits in your node_modules forever for a job you finished in an hour. npx runs it once, writes nothing to disk that you'll trip over later, and gets out of the way.
That's also why I didn't add a config file. There was an early version with a .lovable-eject.json for opting out of certain transforms. I deleted it before shipping. The whole tool is supposed to be a one-shot. Adding configuration meant readers needed to understand the configuration before they could run it. The version without configuration runs in thirty seconds with one command, and the version with configuration would run in thirty seconds plus however long it takes to read the docs.
What I'd say to someone with a stuck Lovable project
You're not actually stuck. The code is yours. npx lovable-eject does the boring conversion in a single command. Whatever host you'd rather use, the project will work there afterwards. If something doesn't, file an issue and I'll patch it.
I built it because I needed it. Put it out because other people probably do too.