Edit in GitHubLog an issue

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.


Using the command with npx:

Copied to your clipboard
1npx @magento/pwa-buildpack create-project ./new-pwa \
2 --name @magezilla/new-pwa \
3 --template venia-concept \
4 --backend-url https://local.magento \
5 --author MageZilla

This command creates a new project in the ./new-pwa folder. The package metadata for the project lists the project name as @magezill/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:

Copied to your clipboard
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>.

--templateNPM package or directory name of the template to use for the new project. Currently only venia-concept is supported.
--backend-urlURL value, set in the .env file, of the backend instance to use in developer mode.
--nameName for the package.json "name" field. Must be a legal NPM package name. Defaults to directory name.
--authorText for the package.json "author" field. Usually a name followed by an email address in angle brackets.
--installWhether to install dependencies after project creation. Defaults to true.
--npm-clientNPM client used to manage this repository. Both npm (the default) and yarn are supported.
  • Privacy
  • Terms of Use
  • Do not sell my personal information
  • AdChoices
Copyright © 2022 Adobe. All rights reserved.