Package local HTML or a static site with Pake CLI
Run your production build, then point Pake CLI at the output folder with pake ./dist --name my-tool. The folder needs an index.html at its root, and its files are packaged into the app, so it opens without a server. The desktop app takes websites only, so local files are a CLI job.
What Pake does with your files
When the input is a path instead of a URL, Pake copies the files into its own dist folder inside the installed CLI package, sets the app's entry to index.html, and marks the window as a local page. Tauri bakes that folder into the binary it builds, so the finished app carries your files with it. After a directory build or a --use-local-file build, Pake restores its original dist so the next app does not inherit your files. The source for this is handleLocalFile in the CLI's bin/helpers/merge.ts.
This explains most of the rules below. The entry file must exist at the root, because that is what the window opens. A directory is copied whole, so whatever is in it ships. And anything the page loads from the network at run time is not packaged, because only files on disk were copied.
Pake accepts three input forms, documented in the CLI reference:
| Input | Example | What is packaged |
|---|---|---|
A directory with index.html at its root | pake ./dist --name my-tool | The whole tree |
| A single HTML file | pake ./page.html --name my-page | That file only |
A single HTML file plus --use-local-file | pake ./my-app/index.html --name my-tool --use-local-file | The folder that contains the file, with all sub-files |
Directory packaging needs CLI 3.15.0 or later; packaging a single file needs 3.0.0 or later (advanced usage). Check yours with pake --version.
Package a build output
- Run the project's production build, which is usually
npm run buildorpnpm build. Use the output directory, such asdist, not the source folder that needs a dev server. - Open the output folder and confirm
index.htmlis at its top level and that the JavaScript, CSS, fonts and images the page uses are next to it. - Install the CLI and the platform's build tools following getting started: Node.js 20.9 or later, Rust 1.85 or later, Xcode Command Line Tools on macOS, Visual Studio Build Tools on Windows.
- Run Pake from the folder that contains
dist:
pnpm install -g pake-cli
pake ./dist --name MyTool
The installer is written to the current folder: a .dmg on macOS, an .msi on Windows, and .deb plus AppImage on Debian and Ubuntu. The first build downloads and compiles dependencies and takes several minutes.
If Pake reports that the directory has no index.html at its root, you pointed it at the wrong level. It stops with "Local directory ... has no index.html at its root", and the hint tells you to use the built output directory. If it says the input contains the Pake CLI installation itself, point it at your build output directory, not at a folder that contains pake-cli.
A single page with neighbors
For one HTML file that loads its own style.css, app.js and images, the single-file form copies only that file unless you add --use-local-file:
pake ./my-app/index.html --name my-tool --use-local-file
With the flag, Pake copies the folder containing the file and everything below it. Keep that folder limited to what the app needs. Anything beside the page, including notes or credentials you forgot about, is copied and ends up inside the app. When in doubt, put the app in its own folder, or use the directory form on a clean build output.
Routing and paths
Hash-based routing works out of the box for local packaging, so URLs like index.html#/settings are fine. History-mode single-page-app routing, where the server rewrites every path to index.html, is not supported yet (CLI reference). If your router has a hash mode, build with it for the packaged version.
Asset paths are the second thing to check. Many build tools write absolute paths such as /assets/app.js by default. Vite, for example, has a base option, and setting it to ./ makes generated URLs relative to each file (Vite build guide). If a packaged app opens to a blank window, test with a relative base before assuming something else is wrong. Test how absolute paths resolve in the packaged app on each target platform.
Is it offline?
A packaged page does not need a server to open, but it is not automatically offline. A page that loads a font from a CDN, calls an API, or pulls a script from a remote host still needs the network for those parts. To check, build the app, disconnect, and open every screen you care about. Use --debug to enable developer tools and logging when something fails to load (debug option).
Local apps also behave differently from website apps in one small way. Website apps reopen on the page where you left off, but local HTML apps do not save or restore the URL.
A development server is a different case
pake http://localhost:3000 --name Dev creates an app that points at that address. It does not bundle the server and does not start it. For a tool you want to hand to someone else, build the static files and package those. For a service that needs a backend, the backend has to be running somewhere the app can reach, and the people who use the app need to know that.
For a Mac or Windows build you cannot run locally, the form-based GitHub Actions workflow takes a website URL only, so it is for public sites, not local files.
Native features on local pages
Pake gives native bridge access, through window.__TAURI__.core.invoke, to bundled local pages and the exact configured website origin (advanced usage). If your static tool needs to talk to the app container, that is the route; a page that does not can ignore it.
FAQ
Can I package a React or Vue project directly?
Package its build output. The source folder needs a dev server and a build step. Run the production build and package the folder it writes.
Does the desktop app accept a local file?
No. Its address field takes http or https addresses (Create an app). Use the CLI for local files.
How do I update a packaged app when my page changes?
Run the build again and package again. The files are embedded when the app is built, so the old app does not see your edits.
Which output do I get on each system?
A .dmg on macOS, an .msi on Windows, and .deb plus AppImage on Debian and Ubuntu. Other targets are in the options reference. If you are choosing between the desktop app and the CLI for a project in general, read which approach fits.
