Building your app for production happens through one build
.
It takes the first argument as the platform, which defaults to web
.
npx one build [web | ios | android]
To build for iOS for example, you would run:
npx one build ios
When building One for web, the output will be a mostly static directory of HTML, CSS, and JavaScript. Internally, One runs a few different Vite production builds to output client, server, and API folders. This output is always in the dist
directory.
Ensure your .env
file has a ONE_SERVER_URL
set to your production URL, like:
Terminal
We provide a production server based on Hono with one serve
that handles loaders, SSR, and API routes for you. You can choose a deploy target for that server, for now we support node
and vercel
(in beta). This can be chosen via your Vite configuration:
vite.config.ts
The CLI will print instructions on how to deploy to the respective platform you choose after you run npx one build
.
If you are only using SPA and SSG routes and aren't using loaders, you can statically serve the results of dist/client
using any server you'd like.
We don't have an end-to-end build command yet, but One is designed to be easy to integrate into existing Expo or React Native build processes.
If you're familiar with EAS, see how to Build and Deliver Native Apps with EAS.
Or check out the iOS Native Guide for instructions on building your iOS app with Xcode.
Edit this page on GitHub.