Packaging
Packaging turns your application into files your users install and start without your development tools. First set your application up for release, which depends on your programming language. Then each platform page shows how to build and package it.
-
Set your application up for release:
A release build, with
cargo build --release, makes an optimized executable. It contains your compiled.slintfiles and the images and fonts they use, so it depends only on system libraries.Build in release mode, with
CMAKE_BUILD_TYPEset toRelease. Embed the images and fonts of your.slintfiles into the executable, since by default the application loads them from their paths on the build machine:set_property(TARGET my_application PROPERTY SLINT_EMBED_RESOURCES embed-files)cmakeSee Resource Embedding for the other options. The package also contains Slint’s shared library. Each platform page shows where it goes so that the executable finds it.
Node.js builds an executable from its own binary, as a single executable application ↗. Your code goes into the executable, and Slint’s native addon and your
.slintfiles stay next to it. This requires Node.js 25.5 or newer, which is also the Node.js your application runs on. Build on each platform you target: npm installs native addons, including Slint’s, for the platform it runs on.Bundle Your Code
Section titled “Bundle Your Code”The executable runs one script built into it, and that script loads only the built-in modules ↗ of Node.js. A bundler combines your code and its dependencies into that script. Use esbuild with the plugin of
slint-uiso thatimport { MainWindow } from "./ui/main.slint"works in the bundle.Install esbuild ↗:
Terminal window npm install --save-dev esbuildbashSave this as
build.mjs, with your entry point inentryPoints:import * as esbuild from "esbuild";import { slint } from "slint-ui/esbuild";await esbuild.build({entryPoints: ["main.js"],bundle: true,platform: "node",format: "esm",outfile: "main.bundle.mjs",plugins: [slint()],});jsnode build.mjswritesmain.bundle.mjs, and copies Slint’s native addon next to it. The plugin compilesimport { MainWindow } from "./ui/main.slint"into aloadFile()call, so the.slintfile loads at run time from the same path relative to the bundle. In every module of the bundle,import.meta.urlis the location of the bundle, so build other paths, such as those forloadFile(), relative to it.Describe the Executable
Section titled “Describe the Executable”Describe the executable in
sea-config.json. On Windows, name the outputmyapp.exe:{"main": "main.bundle.mjs","mainFormat": "module","output": "myapp","disableExperimentalSEAWarning": true}jsonnode --build-sea sea-config.jsonthen builds the executable. It loads Slint’s addon,slint-ui.<platform>.node, from the directory that contains the executable, and your.slintfiles and other assets from the paths the bundle uses. The platform pages show where these files go in the package. The native addons of other packages your application uses are loaded the same way, as their documentation describes.Without esbuild
Section titled “Without esbuild”If your project already uses another bundler, keep it. It works if your code loads
.slintfiles withloadFile(), and you copy Slint’s addon next to the bundle.Some dependencies break when bundled, such as one that reads files next to its own source, or that picks the module to load at run time. For those, skip the bundler, at the cost of putting your code and
node_modulesnext to the executable. The executable’s built-in script can only load built-in modules, so build it from asea-main.cjsthat startsstart.cjsfrom the disk. Leave outmainFormat, and putstart.cjsnext to the executable:// sea-main.cjs, built into the executablerequire("node:module").createRequire(__filename)("./start.cjs");js// start.cjsimport("slint-ui/register").then(() => import("./main.js"));js -
Build and package it for each platform:
© 2026 SixtyFPS GmbH