Embark offers a lot of fine control when it comes to configuring the different parts of our decentralized application. In this guide we’ll take a closer look at the basic configuration options provided by our application’s
embark.json file, which are mainly relevant for, but not restricted to, our application structure.
For configuration options related to connecting to a blockchain client, deploying your Smart Contracts, decentralized storage, Whisper or ENS, please head over to the dedicated configuration guides respectively.
Every application created with Embark comes with an
embark.json file. This file configures where Embark has to look for Smart Contract files and assets, as well as plugins options. Here’s what a freshly scaffolded
embark.json file could look like:
Let’s look at the different options and learn what they do and mean.
This is a list of directories in which Embark should look for Smart Contract files. These typically are globbing patterns (e.g
["contracts/**/*.sol"] will match all sol files inside any folders inside
In the key/value pairs of
app, every key describes the destination, while the value describes a list of glob patterns for files to be transformed and copied.
- index.html - The entry point of our application (
- images - All image assets of our application that we can find in
Change these configurations as you need.
The directory to which the build artifacts are being moved to. Everything inside this configured folder can be considered a production ready build (default is
When using Embark with any other complementary CLI tool for building a DApp, such as Create-React-App or Angular CLI,
buildDir should point at the same location as the complementary tool writes its distribution files to.
This is important so that Embark picks up the right files when doing things like deploying your app on IPFS or Swarm.
A directory in which Embark is going to generate artifacts that can be used for DApp development. This include Smart Contract ABIs as well Embark specific configuration data extracted from the project’s configuration. The default name of this directory is
embarkArtifacts. To learn more about Embark Artifacts, head over to our guide on Using EmbarkJS.
This is the location of the configuration files. There are different options to configure those:
- A string (e.g
"config/") - Will assume the directory in which the configuration files are located (
- An object:
- Each property would configure the path of each configuration file
- Configuration properties can be set to false to disable the component/service in question
Here you can optionally specify the versions of the library to be used by Embark. Embark will automatically download the specific library version if necessary. It’s possible to override this in other configuration files such as
contracts.json on a per environment basis.
This is a list of installed plugins. For more information on Plugins, head over to our Plugins guide.
options property enable us to configure options for specific components and services of Embark and our application. Currently supported are options for the
solc compiler, as well as options related to Embark’s
As mentioned in the section above, it’s possible to configure how Embark behaves when resetting projects. Most of the time, the default configuration should do the trick, however, if we need more control over what files should be removed as part of the reset, we can do that using the
It comes with two properties:
- defaults - Tells Embark whether it should reset the default files it usually resets or not
- files - A list of files Embark should remove as well when resetting the project
With these two options we have full control over what files
reset will remove.