Configuration
Configuration is read from inca.config.ts in your app's root. Other JS and JSON extensions work too. defineConfig is a typing helper; it returns what you give it.
import { defineConfig } from "@incajs/cli/config";
export default defineConfig({
productName: "Click Counter",
identifier: "com.example.click-counter",
icon: "assets/icon.icns",
window: {
width: 1024,
height: 768,
},
});NOTE
package.json's "inca" key still works and is deprecated. inca package prints a warning, and inca.config.ts wins where both set the same key.
The app
productName
- Type:
string - Default:
package.json's own"name", with any npm scope (@org/) stripped
The name the operating system shows for the running app (the Dock and the menu bar on macOS, the taskbar on Linux) in the development window as well as once packaged.
It also names the packaged app's own directory on macOS (<productName>.app); on Linux the directory is a slugified version of it instead (lowercased, non-alphanumeric runs collapsed to -).
Either way it can't hold any of / \ : * ? " < > | or a null byte, can't be . or .., and can't open or close with a space.
inca package refuses a name whose directory matches a top-level file or folder of the build output, such as assets or chunks.
identifier
- Type:
string - Default: a generated
org.inca.<slug>
A reverse-DNS-style unique id: CFBundleIdentifier on macOS, the window's app_id on Wayland and its WM_CLASS on X11. It should be world-unique, so inca package prints a note when it falls back to the generated one.
icon
- Type:
string, a path, resolved from the app's root directory - Default: none
A .icns file that must exist. macOS shows it in the Dock, in the development window as well as once packaged. Linux shows no icon.
version
- Type:
string - Default:
package.json's own"version", then"0.0.0"
The packaged app's version.
The window
Every key here is covered in prose by Application Window.
window.width / window.height
- Type:
number, in pixels - Default: the
width/heightthe app's root element declares, then 800 × 600
The size the window opens at. Each dimension falls through on its own.
window.title
- Type:
string - Default:
productName
The window's title bar.
window.resizable
- Type:
boolean - Default:
false
Whether a user can resize the window.
window.minWidth / window.minHeight
- Type:
number, in pixels - Default: none
The smallest the window can be. It opens at least this size.
The build
entry
- Type:
string, a path, resolved from the app's root directory - Default: the first of
src/main.mts,src/main.tsandsrc/main.jsthat exists, otherwisesrc/App.vuewrapped in a synthesized entry
The app's entry point. A src/main file gives full control over bootstrapping and wins over src/App.vue. Without entry, inca dev selects the entry again while the app runs.
outDir
- Type:
string, a path, resolved from the app's root directory - Default:
"dist"
Where a build's output is written. inca dev writes to a directory of its own and leaves outDir alone. outDir can't be, or contain, the app's root, src/, node_modules/ or entry, and the check follows symlinks. See Error Codes.
sourcemap
- Type:
boolean - Default:
false
Writes a source map, bundle.js.map, beside the bundle in inca build and inca package. With the map, an error in the built app names the .vue or .ts file, line and column. The --sourcemap and --no-sourcemap flags override this key for one run. inca dev always writes the map.
An error's stack frames follow the map, with one difference. A block comment that holds a lone carriage return (\r without \n) shifts the reported line of every frame below it by one.
Development
dev.stackPaths
- Type:
"relative" | "absolute" - Default:
"relative"
How an error's stack names a source file. "relative" gives the path from the app's root, "absolute" the full path. Only inca dev applies it. Built and packaged apps always use "relative".
dev.hmr
- Type:
boolean - Default:
true
Whether inca dev replaces the module you edited. false reloads the whole app. See Hot Module Replacement. Only inca dev applies it.