Snaps configuration options
This reference describes the syntax of the Snaps command line interface (CLI) configuration options. You can specify these options in the configuration file.
customizeWebpackConfig
- Syntax
- Example
customizeWebpackConfig: <FUNCTION>,
customizeWebpackConfig: (config) =>
merge(config, {
plugins: [
// Add a plugin.
],
module: {
rules: [
// Add a loader.
],
},
}),
A function that customizes the Webpack configuration. For example, you can use this option to add a Webpack plugin, provide a polyfill, or add a loader.
The function should receive the Webpack configuration object and return the modified configuration object.
For convenience, the Snaps CLI exports a merge
function that you can use to merge the
configuration object with the
default Webpack configuration.
environment
- Syntax
- Example
environment: <ENVIRONMENT>,
environment: {
SNAP_ENV: process.env.SNAP_ENV,
PUBLIC_KEY: process.env.PUBLIC_KEY,
},
The environment configuration.
You can use this to set environment variables for the Snap,
which can be accessed using process.env
.
evaluate
- Syntax
- Example
evaluate: <BOOLEAN>,
evaluate: true,
Enables or disables evaluating the bundle.
When set to true
, the bundle is checked for compatibility issues with the Snaps runtime.
If there are any issues, the CLI exits with an error.
experimental
Experimental features.
These features are not stable, and might change in the future.
experimental.wasm
- Syntax
- Example
experimental: {
wasm: <BOOLEAN>,
},
experimental: {
wasm: true,
},
Enables or disables WebAssembly support.
When set to true
, WebAssembly files can be imported in the Snap.
For example:
import program from "./program.wasm"
// Program is initialized synchronously.
// ...
features
features.images
- Syntax
- Example
features: {
images: <BOOLEAN>,
},
features: {
images: false,
},
Enables or disables image support.
The default is true
.
input
- Syntax
- Example
input: <FILE>,
input: "src/index.js",
The entry point of the Snap.
This is the file that will be bundled.
The default is "src/index.js"
.
manifest
The Snap manifest file configuration.
manifest.path
- Syntax
- Example
manifest: {
path: <FILE>,
},
manifest: {
path: "snap.manifest.json",
},
Path to the Snap manifest file.
The default is "snap.manifest.json"
.
manifest.update
- Syntax
- Example
manifest: {
update: <BOOLEAN>,
},
manifest: {
update: false,
},
Enables or disables updating the manifest file with the bundle shasum, and making any other possible updates.
If set to false
, the manifest is not updated, and an error is thrown if the manifest is not up-to-date.
The default is true
.
output
The output configuration.