overlayed bundle zips your project into two uploads: an app bundle (your Electron code)
and a site bundle (your frontend). What lands in each zip is decided entirely by the app and site globs in your
overlayed.config.ts. This guide walks through getting those globs right - pulling in the runtime dependencies your app
needs, trimming out the files it doesn’t, and keeping the config working across development and CI.
How Bundling Reads Your Config
Three facts shape every decision below:- There is no
npm installon the server. The build only sees the files you bundle. If a runtime dependency isn’t matched by anincludeglob, it won’t exist in production - this is the single most common cause of a working dev build that crashes once released. appandsiteare bundled independently. Each has its owninclude,exclude, andbaseDir. You can bundle just one at a time, and they can point at completely different directories.- Globs are resolved relative to the config file - or to
baseDirwhen you set it.package.jsonandnode_modules/@overlayed/appare always added to the app bundle, andoverlayed.config.tsis always excluded from both bundles (the app bundle also excludes anyinstallerfolder; the site bundle does not).
npm install, and we do not build your site. You compile your Electron code and your frontend however you like,
with whatever tooling and dependencies you choose, and the bundle ships exactly those files. That keeps your build
pipeline fully in your control. The one thing we do build for you is the Electron app: your app bundle is turned
into a signed installer for your users.Configuring the Two Bundles
Start from a distribution-ready config
applicationId from the environment and describes both bundles. This is the shape
to work from:loadEnv keeps the ID out of source control and lets the same file resolve a different application in CI
versus locally. applicationId must be a valid ULID - defineConfig throws immediately if it isn’t.site config in place year-round - it does nothing until you bundle.Include your app's runtime dependencies
node_modules package your Electron process loads at
runtime. List each one explicitly so unused dependencies don’t bloat the zip:Point the site bundle at your build output
baseDir to your frontend’s build directory so the pattern stays a simple **/* instead of repeating the
prefix. Everything under baseDir is resolved relative to it:.html file - if the glob matches no HTML, overlayed bundle fails
with Site bundle must contain at least one HTML file.Bundle and verify
--debug flag. In debug mode the CLI writes
.overlayed/tmp/debug-app.zip and .overlayed/tmp/debug-site.zip instead of uploading, and logs each file
it adds:package.json are all present and nothing secret
or oversized slipped in.Excluding Files
When a broadinclude is easier than enumerating everything, cast a wide net and trim it with exclude. It accepts a
single glob or an array, resolved from the same baseDir as include:
exclude works identically
on the site bundle - for example, dropping **/*.map from a frontend build.
Reserved Files
A few names are reserved and will fail the app bundle if your globs pick them up:- An
installfolder at the bundle root (reserved for the installer). - The files
meta.jsonandapp-update.ymlat the bundle root (reserved for internal use).
include pattern or add an exclude entry for it.
FAQ
Why does my app work in development but crash after release?
Why does my app work in development but crash after release?
npm install - only bundled files
exist in production. Add every node_modules package your main process loads to the app include, then run
overlayed bundle --debug and confirm it’s in the zip.What's the difference between baseDir and prefixing my globs?
What's the difference between baseDir and prefixing my globs?
baseDir also sets where relative paths in the zip start. baseDir: "./out/renderer" with include: ["**/*"] bundles the contents of out/renderer at the zip root - ideal for a
site whose index.html must sit at the top level.Do I need a site config during development?
Do I need a site config during development?
site in the config so overlayed bundle can build it when you ship.Can I bundle from a monorepo where dependencies are hoisted?
Can I bundle from a monorepo where dependencies are hoisted?
@overlayed/app and @overlayed/electron defaults to ./node_modules relative to
the app baseDir; point it elsewhere with nodeModulesDir, or take full control with resolvePackageVersion.
See the reference.How do I keep the applicationId out of source control?
How do I keep the applicationId out of source control?
loadEnv (shown above) and store the value in a .env file you gitignore, or
in your CI secrets. The ID must still resolve to a valid ULID at bundle time.Can I bundle without a git repository or CI commit?
Can I bundle without a git repository or CI commit?
git rev-parse HEAD; override it - or omit it entirely by returning
undefined - via resolveCommitHash in the config.My site bundle fails with 'must contain at least one HTML file'.
My site bundle fails with 'must contain at least one HTML file'.
include matched no .html. Check that baseDir points at the built output (not your source directory)
and that the build ran before bundling.
