Newer Version Available
Create a Salesforce DX Project
A Salesforce DX project has a specific structure and a configuration file that identifies
the directory as a Salesforce DX project.
-
Use the force:project:create command to create a
skeleton project structure for your Salesforce DX project. If you don’t indicate an output
directory, the project directory is created in the current location. You can also specify
the default package directory to target when syncing source to and from the scratch org.
If you don’t indicate a default package directory, this command creates a default package
directory, force-app.
The force:project:create command generates these samples configuration files to get you started:
- sfdx-project.json
- config/project-scratch-def.json
- .forceignore
Example
1sfdx force:project:create --projectname mywork
2sfdx force:project:create --projectname mywork --defaultpackagedir myappNext steps:
- (Optional) Register the namespace with the Dev Hub org.
- Configure the project (sfdx-project.json). If you use a namespace, update this file to include it.
- Create a scratch org definition that produces scratch orgs that mimic the shape of another org you use in development, such as sandbox, packaging, or production. The config directory of your new project contains a sample scratch org definition file.