web2app Developer Guide
Compile Next.js, Vite, React, Vue, Svelte, Python, or live URLs into standalone native Android, Windows, Debian, and Arch apps with zero runtime bloat.
Introduction & Motivation
Traditional desktop and mobile packaging toolchains (like Electron, Cordova, or standard hybrid shells) bundle a 150MB+ Chromium browser binary and separate Node.js runtime into every application. This leads to massive file sizes, high idle RAM consumption, and complicated configuration workflows.
web2app compiles directly to native operating system WebViews: It takes your web application (Next.js, Vite, React, static HTML) or a live web URL, bundles it into clean native wrappers, and generates a structured app/ directory containing ready-to-run packages for Android, Windows, Debian/Ubuntu, and Arch Linux.
Instant 10-Second Conversion
You can convert any live web URL or local project without installing anything beforehand using npx:
AConvert a Live Web Page URL
BConvert Current Project (Next.js / Vite / React / HTML)
web2app build, the compiler auto-detects your web framework, compiles static production assets, copies native wrappers, and generates the complete app/ directory.Installation & Script Runner Setup
web2app can be used as a global CLI, an npm devDependency with automated scripts in your package.json, or executed instantly via npx.
1. Global Installation (Recommended for Terminal Users)
2. Project DevDependency & NPM Scripts
Add web2app directly to your project dependencies so teammates and CI/CD pipelines can run automated build scripts:
Add these standard script targets to your package.json:
3. Local Contributor Linking
Project Initialization Wizard
Run web2app init inside your project root to interactively configure your app name, package ID, target platforms, and icons:
package.json:Zero-Runtime Overhead Architecture
Traditional desktop frameworks package entire browser binaries, rendering engines, and Node.js runtimes into each application. web2app takes an architectural approach that relies on native operating system WebViews:
Android: AndroidX WebViewAssetLoader
Uses Androidβs native WebKit with secure local asset loading, GPU hardware acceleration, and full HTML5 IndexedDB storage support.
Windows: MS Edge / Chromium App Mode
Leverages Microsoft Edge App Mode with custom window boundaries, silent VBScript launch runners, and Start Menu registry shortcuts.
Linux: Pure TypeScript DebPackager
Generates valid Debian binary .deb packages with XDG desktop application entries and scalable SVG/PNG icon hierarchies without requiring dpkg on the host machine.
Unified app/ Directory Structure
When you run web2app build, the compiler produces clean, modular platform packages in ./app/:
Android Packaging (APK / AAB)
The Android engine generates a lightweight Kotlin project utilizing modern androidx.webkit.WebViewAssetLoader.
Windows Desktop (WebView2 & App Mode)
Generates a standalone Windows Desktop application folder in app/windows/ with silent background launchers (start.vbs) and installation scripts.
Debian / Ubuntu (.deb) Binary Packages
web2app includes an internal, pure TypeScript DebPackager engine that constructs valid Unix ar archives and tar.gz payloads without requiring dpkg-deb on the build machine.
Arch Linux (PKGBUILD & AUR)
Generates standard Arch Linux PKGBUILD and .SRCINFO files compatible with makepkg -si and AUR publication.
Next.js (App Router & Pages Router)
To bundle your Next.js application for offline execution inside standalone native apps, configure static HTML export in next.config.ts:
Vite, React, Vue & Svelte
Vite and Single Page Applications work out of the box. Ensure your asset base path is set to relative (base: './'):
Python (Streamlit, Flask, FastAPI)
For Python web applications, deploy your app or launch a local server and pass the URL to web2app:
CLI Commands Reference
| Command | Description | Options |
|---|---|---|
| web2app [url] | Converts a live URL into Android, Windows, Debian, and Arch apps | --app-name, --out |
| web2app build | Builds all target platforms into ./app/ | --release, --bundle, --out |
| web2app doctor | Diagnoses Java JDK, Android SDK, ADB, and packaging tools | - |
| web2app init | Interactive setup wizard for web2app.config.ts | --yes, --force |
| web2app run android | Builds and installs APK onto connected emulator or device | --device |
| web2app skill | Installs AI Agent Skill definition in .agents/skills/web2app | --print, --force |
web2app.config.ts Reference
Complete TypeScript interface for customizing application metadata, platform targets, orientation, permissions, and icons:
AI Agent Skill Integration
web2app includes a standardized AI Assistant Skill formatted for Google Antigravity, Claude Code, Cursor, Windsurf, and Copilot.
Install the skill into your project with a single command:
.agents/skills/web2app/SKILL.md in your workspace. AI coding assistants will automatically detect frameworks, configure static exports, run doctor checks, and compile native targets.Ready-to-Use AI Prompt Recipes
Android Keystore & APK Signing
For Google Play Store distribution, generate a release keystore and sign your production APK / AAB:
GitHub Actions CI/CD Pipeline
Troubleshooting & FAQ
1. How do I fix "JAVA_HOME not set" during Android builds?
Install OpenJDK 17 or 21 (e.g. sudo apt install openjdk-21-jdk on Ubuntu or brew install openjdk@21 on macOS) and run web2app doctor.
2. Can I convert web apps with real-time WebSockets and IndexedDB?
Yes! All native WebViews (AndroidX WebKit, MS Edge WebView2, Linux WebKit) fully support modern HTML5 APIs including WebSockets, IndexedDB, Web Workers, Canvas, WebGL, and LocalStorage.