Skip to main content

Snaps command line options

b, bundle

--bundle <file>

Path to the snap bundle file. The default is dist/bundle.js.

You can use this option with the eval subcommand.

-b is an alias for --bundle.

d, dist

--dist <directory>

Path to the output directory. The default is dist.

You can use this option with the build and watch subcommands.

-d is an alias for --dist.

depsToTranspile

--depsToTranspile <array>

List of dependencies to transpile, if --transpilationMode is set to localAndDeps.

You can use this option with the build and watch subcommands.

e, eval

--eval <boolean>

Indicates whether to attempt to evaluate the snap bundle in SES. The default is true.

You can use this option with the build and watch subcommands.

-e is an alias for --eval.

fix, writeManifest

--fix <boolean>

When validating the snap manifest file using the manifest subcommand, indicates whether to make necessary changes to the manifest file. The default is true.

--fix is an alias for --writeManifest.

h, help

-h, --help

Displays the help message and exits. You can use this option with mm-snap or any subcommand.

-h is an alias for --help.

m, manifest

--manifest <boolean>

Indicates whether to validate the snap manifest file. The default is true.

You can use this option with the build and watch subcommands.

-m is an alias for --manifest.

n, outfileName

--outfileName <string>

Output file name when building a snap from source. The default is bundle.js.

You can use this option with the build and watch subcommands.

-n is an alias for --outfileName.

p, port

--port <number>

Local server port for testing. The default is 8081.

You can use this option with the serve and watch subcommands.

-p is an alias for --port.

r, root

--root <directory>

Server root directory. The default is the current working directory (.).

You can use this option with the serve and watch subcommands.

-r is an alias for --root.

s, src

--src <file>

Path to the snap source file. The default is src/index.js.

You can use this option with the build and watch subcommands.

-s is an alias for --src.

sourceMaps

--sourceMaps <boolean>

Indicates whether builds should include source maps. The default is false.

You can use this option with the build and watch subcommands.

strip, stripComments

--strip <boolean>

Indicates whether to remove code comments from the build output. The default is true.

You can use this option with the build and watch subcommands.

--strip is an alias for --stripComments.

suppressWarnings

--suppressWarnings <boolean>

Indicates whether to suppress warnings. The default is false.

You can use this option with any subcommand.

transpilationMode

--transpilationMode <string>

Babel transpilation mode. Specify localAndDeps to transpile all source code including dependencies, localOnly to transpile local source code only, and none to transpile nothing.

The default is localOnly.

You can use this option with the build and watch subcommands.

note

For TypeScript snaps, --transpilationMode must be set to either localOnly or localAndDeps.

verboseErrors

--verboseErrors <boolean>

Indicates whether to display original errors. The default is true.

You can use this option with any subcommand.

version

--version

Displays the version number and exits.