This is the pre-release documentation site for the Magento PWA project. To provide feedback or contribute content, check out the pwa-devdocs repository.

Link project to the Magento backend

In the previous topic, you created a package.json file and installed the project dependencies. In this topic, you will use Composer to link your project with the Magento backend store.

Install project using Composer

  1. Navigate to the root directory of your Magento installation.
  2. Run the following command to add your theme project directory as a module repository to Magento’s composer.json:

    composer config repositories.pwadev \
    '{"type":"path","url":"path/to/orange-theme","options":{"symlinks":true}}'
    
  3. Run the following command to add your theme to composer.json as a local linked dependency:

    composer require --dev orangecompany/orange-theme
    

Check installation

Command line

In the root directory of your Magento installation, run the following command:

ls -og vendor/orangecompany | grep "^l"

This command shows the orange-theme symlink directory inside the vendor/orangecompany directory and the path to the real project directory.

lrwxr-xr-x   1    37 Apr 11 21:54 orange-theme -> path/to/orange-theme

Since the theme project is installed using a symlink, any edits made in the original location appear on the store without re-installing the plugin.

Admin

Log into the Admin section of your Magento installation and select Themes in the Content tab.

You should see Orange Theme listed as one of the available themes in Magento.

To install the theme, select Configuration in the Content tab and set your storefront to use the Orange Theme.

The next step is to create the configuration files.