Configuring project definition JSON

The sfdx-project.json file enables the configuration parameter to set sourceAPIVersion and namespace if you are building a managed package application.

A sample sfdx-project.json file is as follows:

{
"packageDirectories": [{
"path": "force-app",
"default": true
}],
"namespace": "",
"sfdcLoginUrl": "https://login.Salesforce.com",
"sourceApiVersion": "40.0"
}

packageDirectories is the location of the directory to which the source from the scratch Org (managed package, unmanaged package, or unpacked code) will be pulled and pushed. We can specify multiple paths, but only one path can be the default. The following code shows an example of how to specify multiple paths:

{ 
"packageDirectories" : [
{ "path": "force-app", "default": true},
{ "path" : "unpackaged" },
{ "path" : "utils" }
],
"namespace": "",
"sfdcLoginUrl" : "https://login.Salesforce.com",
"sourceApiVersion": "40.0"
}

You can specify the directory name when pulling and pushing source code to scratch Orgs.