Create project
The create-project sub-command of the buildpack CLI is a scaffolding tool used to create a fresh PWA Studio app in a new project directory. Normally this command is used indirectly through the @magento/pwa scaffolding tool. The tool collects the parameter values through its interactive prompt and passes them on to this command as options. This tool is also available for developers or third-party automation tools to use directly.
Example
Using the command with npx:
npx @magento/pwa-buildpack create-project ./new-pwa \
--name @magezilla/new-pwa \
--template venia-concept \
--backend-url https://local.magento \
--author MageZilla
This command creates a new project in the ./new-pwa folder. The package metadata for the project lists the project name as @magezilla/new-pwa and the author as MageZilla. It also creates a .env file with the backend URL set to https://local.magento.
After creating the project, it installs the package dependencies, including the Venia, Peregrine and Buildpack libraries needed to build the application.
Running the command
Use the npx tool to download the current version and execute the command:
npx @magento/pwa-buildpack create-project <directory> [<options> ...]
The first argument in the command is the directory for the new project. If the directory does not exist, it is created. If the directory is not empty, files that the tool generates overwrite the existing files.
The directory can be the current directory ., which is the default if no first argument is passed.
Do not install buildpack globally on your development system to use this command. This can cause incompatible versions between a product version and the global version.
Command options
Run npx @magento/pwa-buildpack create-project --help to see the list of command options.
You can specify these options in any order after buildpack create-project <directory>.
--templatevenia-concept is supported.--backend-url.env file, of the backend instance to use in developer mode.--namepackage.json "name" field. Must be a legal NPM package name. Defaults to directory name.--authorpackage.json "author" field. Usually a name followed by an email address in angle brackets.--installtrue.--npm-clientnpm (the default) and yarn are supported.data-variant=warning
data-slots=text