Build
Build and package a NarraLeaf desktop app.
narraleaf build creates production build output and packages the app.
narraleaf buildBuild Steps
The command runs three phases:
Build renderer
The CLI scans renderer/pages, creates the temporary renderer entry, bundles React output, and writes renderer files under the configured temp directory.
Build main
The CLI bundles your configured main entry for Electron main and copies the NarraLeaf preload bundle.
Pack app
The CLI calls Electron Builder with generated files, public assets, resources, licenses, and configured targets.
Output
The packaged app is written to build.dist, which defaults to dist.
module.exports = {
build: {
dist: "dist",
productName: "My Visual Novel",
},
};Fast Packaging
Set build.dev to true for development-oriented packaging with faster compression.
module.exports = {
build: {
dev: true,
},
};Targets
Configure targets with BuildTarget helpers from narraleaf/config.
const { BuildTarget, WindowsBuildTarget } = require("narraleaf/config");
module.exports = {
build: {
targets: BuildTarget.Windows({
target: WindowsBuildTarget.nsis,
}),
},
};See Build Targets for platform examples.