Skip to content

Build Chrome extension

Bepp includes a functionality to package extensions for the chrome Browser using Chromium extensions with Manifest V3. Additionally, compatibility with Manifest V2 is also supported.

Prerequisites

Usage

bash
bepp build-chrome [options]
js
/**
 * Build Chrome extension.
 * 
 * @see https://bepp.pigeonposse.com/
 * @see https://bepp.pigeonposse.com/guide/lib/build/chrome
 */

import {chrome, buildBrowser} from '@bepp/bepp'

chrome.build({
    /** options **/
})

// Alternative:
buildBrowser('chrome',{
    /** options **/
})

Options

input

Specify the input directory for the extension.

Note

The input directory must be a directory path for a Chromium extension with Manifest 3.

The provided path should point to the directory containing the necessary files for building the extension.

  • CLI option: -i --input
  • JS key: input
  • Type: string

id

Identification for build. Used in filename build. The id option allows you to provide an identification string for the build. This identifier is used in the filename during the build process.

  • CLI option: --id
  • JS key: id
  • Type: string
  • Default: bepp

output

Specify the output directory where the packaged extension will be stored.

  • CLI option: -o --output
  • JS key: output
  • Type: string
  • Default: build/extensions

compress

Compression format for packaging Choose the compression format for packaging the extension.

  • CLI option: -c --compress
  • JS key: compress
  • Type: tar tgz gzip zip
  • Default: tgz

filename

Define the template for the filename of the packaged extension.

Filename placeholders

The filename can include placeholders such:

  • version takes the version number of the extension manifest.
  • id takes the id set by the id option.
  • browser takes the browser's identification name.
  • CLI option: -f --filename
  • JS key: filename
  • Type: string
  • Default: {{id}}-{{browser}}-{{version}}

verbose

Use verbose output.

  • CLI option: -v --verbose
  • JS key: verbose
  • Type: boolean

time

Print execution time.

  • CLI option: -t --time
  • JS key: time
  • Type: boolean

exit

Force exit from process on error.

  • CLI option: -e --exit
  • JS key: exit
  • Type: boolean