The PWA Studio is distributed with the Project Scaffolding. Project Scaffolding is a method of automatic file creation, aimed to support a specific project structure.
PWA Studio offers various instruments to simplify project creation. Also, it allows you to create your own PWA theme, layered on Magento 2. The full documentation is available via Magento PWA Studio documentation.
To create a new project, please run the following command:
yarn create @magento/pwa
After that, an interactive installation process will be started. You’ll have to enter the following information:
In the screenshot below, an example of the installation process is shown.
To go to the project’s directory, run the following command:
$ cd myproject/
You need to create a unique, safe, configurable domain for your new project. To do that, please run the following command.
yarn run buildpack create-custom-origin .
To run the project in the developer mode, please execute the following command:
The project will be started and will be available via address, given to you in the console window. For example, see the screenshot below.
To install the PWA modules to your instance, you need to follow the next steps:
1. Proceed to the required folder using the
cd your_project/src command.
2. Create a new folder with
3. Copy module folder and paste it to
4. For development mode, run
yarn add link:src/@amasty/%module_name% .
For production mode, run
yarn add file:src/@amasty/%module_name%.
Both commands should be run from the directory (your_project folder).
5. If the extension has the Ovverrides folder, copy folder overrides from
src/ and install VeniaUiOverrideResolver for PWA Studio with the commands:
yarn add @fooman/venia-ui-override-resolver
6. Restart your project using the
yarn watch command.