Napacitor Configuration
The Napacitor configuration file is used to set high-level options for Napacitor tooling.
Example
This is an example napacitor.config.json file:
{
"appId": "com.company.appname",
"appName": "My Napacitor App",
"webDir": "dist",
"loggingBehavior": "debug",
"assets": {
"sourceDir": "assets",
"icon": "icon.svg",
"splash": "splash.svg",
"iconColor": "#512BD4",
"splashColor": "#512BD4"
},
"maui": {
"hostDir": "maui"
}
}
Napacitor uses the JSON-format napacitor.config.json. The configuration file lives in the app root directory (the one containing package.json).
Schema
Here is the TypeScript interface for the Napacitor configuration, complete with descriptions and defaults.
export interface NapacitorConfig {
/**
* The unique identifier of your packaged app.
*
* Written to the host csproj's <ApplicationId>. Must be in reverse domain
* name notation, generally representing a domain name that you or your
* company owns.
*/
appId: string;
/**
* The human-friendly name of the app.
*
* Written to the host csproj's <ApplicationTitle>. This is the name you
* see in the app stores, but it can be changed after the host project has
* been generated.
*/
appName: string;
/**
* The directory of the web app's build output (relative to appDir,
* e.g. dist).
*
* This directory must contain the app's final index.html.
*/
webDir: string;
/**
* Logging behavior (same semantics as Capacitor):
*
* 'none' = never log
* 'debug' = log only in Debug builds, not in Release builds
* 'production' = always log (including Release)
*
* Overrides C# runtime logging and JS console forwarding.
*
* @default debug
*/
loggingBehavior?: 'none' | 'debug' | 'production';
/**
* Asset generation configuration section (consumed by `nap assets`;
* `nap add maui` uses its colors to initialize the template).
*/
assets?: AssetsConfig;
/**
* MAUI platform configuration.
*/
maui?: {
/**
* The host project directory (relative to appDir).
*
* @default maui
*/
hostDir: string;
};
/**
* Plugin configuration section.
*
* This is an object keyed by plugin name: plugins.<PluginName>.
*/
plugins?: { [key: string]: { [key: string]: any } | undefined };
}
export interface AssetsConfig {
/**
* Asset source directory (relative to appDir).
*
* @default assets
*/
sourceDir: string;
/**
* Icon source file (relative to sourceDir, svg/png).
* When unset, the conventional names icon.svg/icon.png are looked up.
*/
icon?: string;
/**
* Icon foreground source file (relative to sourceDir). Together with icon
* this forms the "foreground + background" mode, mapping to MAUI
* Resizetizer's MauiIcon ForegroundFile.
*/
iconForeground?: string;
/**
* Splash screen source file (relative to sourceDir, svg/png).
* When unset, the conventional names splash.svg/splash.png are looked up.
*/
splash?: string;
/**
* Icon background color value (written to the csproj's <MauiIcon Color>).
*
* @default #512BD4
*/
iconColor?: string;
/**
* Splash screen background color value (written to the csproj's
* <MauiSplashScreen Color>).
*
* @default #512BD4
*/
splashColor?: string;
/**
* Splash screen BaseSize (the svg vector base size; only applies to svg
* sources).
*
* @default "128,128"
*/
splashBaseSize?: string;
/**
* Color resources injected into Resources/Styles/Colors.xaml
* (XAML x:Key → color value).
*/
colors?: Record<string, string>;
}
Environment Variables
The Napacitor CLI depends on the toolchains installed on your system (dotnet, the Android SDK, etc.) and locates them automatically following platform conventions. If you need to adjust how they are located, the following environment variables are available:
ANDROID_HOME: The directory containing the Android SDK, used by the .NET Android workload. Can also be specified viaAndroidSdkDirectoryin the host csproj;NO_COLOR: Set to any value to disable ANSI colors in CLI output.