Electron builder icon linux

Common Configuration

    in the package.json file of your project using the build key on the top level:

"build":  "appId": "com.example.app" > 

json , json5, toml or js / ts (exported configuration or function that produces configuration) formats also supported.

Tip If you want to use js file, do not name it electron-builder.js . It will conflict with electron-builder package name.

Most of the options accept null — for example, to explicitly set that DMG icon must be default volume icon from the OS and default rules must be not applied (i.e. use application icon as DMG icon), set dmg.icon to null .

Artifact File Name Template¶

$ macro is supported in addition to file macros.

Environment Variables from File¶

Env file electron-builder.env in the current dir (example). Supported only for CLI usage.

How to Read Docs¶

  • Name of optional property is normal, required is bold.
  • Type is specified after property name: Array | String . Union like this means that you can specify or string ( **/* ), or array of strings ( [«**/*», «!foo.js»] ).

Configuration¶

  • appId = com.electron.$ String | “undefined” — The application id. Used as CFBundleIdentifier for MacOS and as Application User Model ID for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.
  • productName String | “undefined” — As name, but allows you to specify a product name for your executable which contains spaces and other special characters not allowed in the name property. If not specified inside of the build configuration, productName property defined at the top level of package.json is used. If not specified at the top level of package.json , name property is used.
  • copyright = Copyright © year $ String | “undefined” — The human-readable copyright line for the app.
  • directories MetadataDirectories | “undefined”
  • mac MacConfiguration — Options related to how build macOS targets.
  • mas MasConfiguration — MAS (Mac Application Store) options.
  • masDev MasConfiguration — MAS (Mac Application Store) development options ( mas-dev target).
  • dmg DmgOptions — macOS DMG options.
  • pkg PkgOptions — macOS PKG options.
  • win WindowsConfiguration — Options related to how build Windows targets.
  • nsis NsisOptions
  • nsisWeb NsisWebOptions | “undefined”
  • portable PortableOptions | “undefined”
  • appx AppXOptions
  • squirrelWindows SquirrelWindowsOptions
  • linux LinuxConfiguration — Options related to how build Linux targets.
  • deb DebOptions — Debian package options.
  • snap SnapOptions — Snap options.
  • appImage AppImageOptions — AppImage options.
  • flatpak FlatpakOptions — Flatpak options.
  • pacman LinuxTargetSpecificOptions
  • rpm LinuxTargetSpecificOptions
  • freebsd LinuxTargetSpecificOptions
  • p5p LinuxTargetSpecificOptions
  • apk LinuxTargetSpecificOptions
  • includeSubNodeModules = false Boolean — Whether to include all of the submodules node_modules directories
  • buildDependenciesFromSource = false Boolean — Whether to build the application native dependencies from source.
  • nodeGypRebuild = false Boolean — Whether to execute node-gyp rebuild before starting to package the app. Don’t usenpm (neither .npmrc ) for configuring electron headers. Use electron-builder node-gyp-rebuild instead.
  • npmArgs Array | String | “undefined” — Additional command line arguments to use when installing app native deps.
  • npmRebuild = true Boolean — Whether to rebuild native dependencies before starting to package the app.
  • buildNumber String | “undefined” — The build number. Maps to the —iteration flag for builds using FPM on Linux. If not defined, then it will fallback to BUILD_NUMBER or TRAVIS_BUILD_NUMBER or APPVEYOR_BUILD_NUMBER or CIRCLE_BUILD_NUM or BUILD_BUILDNUMBER or CI_PIPELINE_IID env.
  • buildVersion String | “undefined” — The build version. Maps to the CFBundleVersion on macOS, and FileVersion metadata property on Windows. Defaults to the version . If buildVersion is not defined and buildNumber (or one of the buildNumber envs) is defined, it will be used as a build version ( version.buildNumber ).
  • downloadAlternateFFmpeg Boolean — Whether to download the alternate FFmpeg library from Electron’s release assets and replace the default FFmpeg library prior to signing
  • electronCompile Boolean — Whether to use electron-compile to compile app. Defaults to true if electron-compile in the dependencies. And false if in the devDependencies or doesn’t specified.
  • electronDist String | module:app-builder-lib/out/configuration.__type — Returns the path to custom Electron build (e.g. ~/electron/out/R ). Zip files must follow the pattern electron-v$-$-$.zip , otherwise it will be assumed to be an unpacked Electron app directory
  • electronDownload — The electron-download options.
    • version String
    • cache String | “undefined” — The cache location.
    • mirror String | “undefined” — The mirror.
    • strictSSL Boolean
    • isVerifyChecksum Boolean
    • platform “darwin” | “linux” | “win32” | “mas”
    • arch String
    • forceCodeSigning = false Boolean — Whether to fail if the application is not signed (to prevent unsigned app if code signing configuration is not correct).
    • nodeVersion String | “undefined” — libui-based frameworks only The version of NodeJS you are packaging for. You can set it to current to set the Node.js version that you use to run.
    • launchUiVersion Boolean | String | “undefined” — libui-based frameworks only The version of LaunchUI you are packaging for. Applicable for Windows only. Defaults to version suitable for used framework version.
    • framework String | “undefined” — The framework name. One of electron , proton , libui . Defaults to electron .
    • beforePack module:app-builder-lib/out/configuration.__type | String | “undefined” — The function (or path to file or module id) to be run before pack
    • afterPack — The function (or path to file or module id) to be run after pack (but before pack into distributable format and sign).
    • afterSign — The function (or path to file or module id) to be run after pack and sign (but before pack into distributable format).
    • artifactBuildStarted module:app-builder-lib/out/configuration.__type | String | “undefined” — The function (or path to file or module id) to be run on artifact build start.
    • artifactBuildCompleted module:app-builder-lib/out/configuration.__type | String | “undefined” — The function (or path to file or module id) to be run on artifact build completed.
    • afterAllArtifactBuild — The function (or path to file or module id) to be run after all artifacts are build.
    • msiProjectCreated module:app-builder-lib/out/configuration.__type | String | “undefined” — MSI project created on disk — not packed into .msi package yet.
    • appxManifestCreated module:app-builder-lib/out/configuration.__type | String | “undefined” — Appx manifest created on disk — not packed into .appx package yet.
    • onNodeModuleFile — The function (or path to file or module id) to be run on each node module file.
    • beforeBuild (context: BeforeBuildContext) => Promise | null — The function (or path to file or module id) to be run before dependencies are installed or rebuilt. Works when npmRebuild is set to true . Resolving to false will skip dependencies install or rebuild. If provided and node_modules are missing, it will not invoke production dependencies check.
    • includePdb = false Boolean — Whether to include PDB files.
    • removePackageScripts = true Boolean — Whether to remove scripts field from package.json files.
    • removePackageKeywords = true Boolean — Whether to remove keywords field from package.json files.

    Overridable per Platform Options¶

    Following options can be set also per platform (top-level keys mac, linux and win) if need.

    • appId = com.electron.$ String | “undefined” — The application id. Used as CFBundleIdentifier for MacOS and as Application User Model ID for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.
    • artifactName String | “undefined” — The artifact file name template. Defaults to $-$.$ (some target can have other defaults, see corresponding options).
    • executableName String | “undefined” — The executable name. Defaults to productName .
    • compression = normal “store” | “normal” | “maximum” | “undefined” — The compression level. If you want to rapidly test build, store can reduce build time significantly. maximum doesn’t lead to noticeable size difference, but increase build time.
    • files The files configuration.
    • extraResources The extra resources configuration.
    • extraFiles The extra files configuration.
    • asar = true AsarOptions | Boolean | “undefined” — Whether to package the application’s source code into an archive, using Electron’s archive format. Node modules, that must be unpacked, will be detected automatically, you don’t need to explicitly set asarUnpack — please file an issue if this doesn’t work.
    • asarUnpack Array | String | “undefined” — A glob patterns relative to the app directory, which specifies which files to unpack when creating the asar archive.
Оцените статью
Adblock
detector