Skip to main content
The top-level snap key contains set of options instructing electron-builder on how it should build Snap.

Configuration

base
string
A snap of type base to be used as the execution environment for this snap. Examples: core, core18, core20, core22.
confinement
'devmode' | 'strict' | 'classic'
The type of confinement supported by the snap.
environment
Record<string, string>
The custom environment. Defaults to {"TMPDIR": "$XDG_RUNTIME_DIR"}. If you set custom, it will be merged with default.
summary
string
The 78 character long summary. Defaults to productName.
grade
'devel' | 'stable'
The quality grade of the snap. It can be either devel (i.e. a development version of the snap, so not to be published to the “stable” or “candidate” channels) or “stable” (i.e. a stable release or release candidate, which can be released to all channels).
assumes
string | string[]
The list of features that must be supported by the core in order for this snap to install.
buildPackages
string[]
The list of debian packages needs to be installed for building this snap.
stagePackages
string[]
The list of Ubuntu packages to use that are needed to support the app part creation. Like depends for deb.If list contains default, it will be replaced to default list, so, ["default", "foo"] can be used to add custom package foo in addition to defaults.
hooks
string
The hooks directory, relative to build (build resources directory).
plugs
Array<string | PlugDescriptor> | PlugDescriptor
The list of plugs.If list contains default, it will be replaced to default list, so, ["default", "foo"] can be used to add custom plug foo in addition to defaults.Additional attributes can be specified using object instead of just name of plug:
[
  {
    "browser-sandbox": {
      "interface": "browser-support",
      "allow-sandbox": true
    },
  },
  "another-simple-plug-name"
]
slots
Array<string | SlotDescriptor> | PlugDescriptor
The list of slots.Additional attributes can be specified using object instead of just name of slot:
[
  {
    "mpris": {
      "name": "chromium"
    },
  }
]
In case you want your application to be a compliant MPris player, you will need to define the mpris slot with “chromium” name. This electron has it hardcoded, and we need to pass this name so snap will allow it in strict confinement.
after
string[]
Specifies any parts that should be built before this part.If list contains default, it will be replaced to default list, so, ["default", "foo"] can be used to add custom parts foo in addition to defaults.
useTemplateApp
boolean
Whether to use template snap. Defaults to true if stagePackages not specified.
autoStart
boolean
Whether or not the snap should automatically start on login.
layout
Record<string, Record<string, string>>
Specifies any files to make accessible from locations such as /usr, /var, and /etc. See snap layouts to learn more.
appPartStage
string[]
Specifies which files from the app part to stage and which to exclude. Individual files, directories, wildcards, globstars, and exclusions are accepted. See Snapcraft filesets to learn more about the format.The defaults can be found in snap.ts.
title
string
An optional title for the snap, may contain uppercase letters and spaces. Defaults to productName. See snap format documentation.
compression
'xz' | 'lzo'
Sets the compression type for the snap. Can be xz, lzo, or null.
allowNativeWayland
boolean
Allow running the program with native wayland support with —ozone-platform=wayland.Disabled by default because of this issue in older Electron/Snap versions: https://github.com/electron-userland/electron-builder/issues/4007
synopsis
string
description
string
As description from application package.json, but allows you to specify different for Linux.
category
string
mimeTypes
string[]
The mime types in addition to specified in the file associations. Use it if you don’t want to register a new mime type, but reuse existing.
desktop
LinuxDesktopFile
executableArgs
string[]
The executable parameters. Pass to executableName

Build docs developers (and LLMs) love