To develop a PWA, we first need to inform Quasar that we want to add a new mode of development. Open Terminal (macOS or Linux) or the Command Prompt/PowerShell (Windows) and execute the following command:
> quasar mode add pwa
Quasar-CLI will create a folder called src-pwa that will have our service-workers files, separated from our main code.
To clean the newly added files, and to lint it into the Airbnb format, we need to open Terminal (macOS or Linux) or the Command Prompt/PowerShell (Windows) and execute the following command:
> eslint --fix --ext .js ./src-pwa
The code that we added to the SPA will still be used as our base so that we can add new pages, components, and other functions to it as well, which will be used on the PWA.
So, are you wondering why service-worker is not in the main src folder? This is because those files are exclusively for PWAs, and are not needed in any other case than this one. The same will happen in...