rishabh3112 / gridsome-plugin-pwa

PWA plugin for gridsome
MIT License
30 stars 18 forks source link

Issue 55/separate maskable icon file #57

Closed cameronrr closed 2 years ago

cameronrr commented 3 years ago

Added ability to specify a separate 'maskable' icon.

This allows developers to create a combination of PWA icons suitable for their applications:

Tested locally using npm link and checked generated manifest.json using manifest-validator. Scenarios tested:

{ icon: 'static/icon.png' } Expected: Manifest contains array of 'any' icons. Expected: dist/assets/static contains single set of icons. Result: As expected

{ icon: 'static/icon.png', maskableIcon: false } Expected: Manifest contains array of 'any' icons. Expected: dist/assets/static contains single set of icons. Result: As expected

{ icon: 'static/icon.png', maskableIcon: true } Expected: Manifest contains array of 'maskable any' icons. Expected: dist/assets/static contains single set of icons. Result: As expected

{ icon: 'static/icon.png', maskableIcon: 'static/icon.png' } Expected: Manifest contains array of 'maskable any' icons. Expected: dist/assets/static contains single set of icons. Result: As expected

{ icon: 'static/icon.png', maskableIcon: 'static/icon-maskable.png' } Expected: Manifest contains array of 'any' and 'maskable' icons. Expected: dist/assets/static contains two sets of icons (maskable, any). Result: As expected

codesandbox-ci[bot] commented 3 years ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit c909a20e74a29ca1a88411d2366ec23a80f53db1:

Sandbox Source
basic Configuration
rishabh3112 commented 2 years ago

@cameronrr Thanks for pull request! It looks great!