Skip to main content

Napacitor CLI - nap copy

Copy the web app's build output into the MAUI host project.

npx nap copy [maui]

Behavior:

  • Reads webDir from napacitor.config.json.
  • Clears the host's wwwroot/ and copies the web build output into it.
  • Applies host-specific adaptations to the copied index.html (so the page loads correctly inside the BlazorWebView).
  • Fails if webDir does not exist or does not contain an index.html — build your web app first.

Example:

npm run build
npx nap copy

Run nap sync instead when you have added or updated plugins, since it also regenerates napacitor.build.props.