Before you link a theme, make sure you have installed Create ScandiPWA App. Use this guide for installing it.
2. Linking a Theme
To link a ScandiPWA theme to your Create Magento App project you can use command link:
npm run link ./path/to/your/scandipwa-app # for NPM
# or with yarn
yarn run link ./path/to/your/scandipwa-app
Create Magento App will link your ScandiPWA theme from your selected path as a symbolic link and will disable Full Page cache.
This is necessary for proper hard-reload when developing Magento Theme.
Disabling Full Page cache is necessary for theme development with hard reload. To enable Full Page cache run this command in CLI:
magento cache:enable full_page
3. Run Create ScandiPWA App Compilation
Run the command below from your ScandiPWA App directory (./path/to/my/scandipwa-app )
BUILD_MODE=magento npm run start # Mac, Linux
setBUILD_MODE=magento &&npm run start &setBUILD_MODE=# Windows
This command will now watch the files and put their compiled versions into the magento/Magento_Theme folder.
Instead of starting your Create ScandiPWA App project, you can also use npm run build. Learn more here.
4. Enable Theme
After you linked theme to your Create Magento App instance you need to activate it.
Go to your Magento Admin panel (by default it can be accessed on /admin url), Content > Configuration, choose a website that you want to apply theme on, click Edit and select your theme, click Save and that is it.