Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 55/separate maskable icon file #57

Merged

Conversation

cameronrr
Copy link
Contributor

Added ability to specify a separate 'maskable' icon.

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

  • Single icon, generate as 'any'
  • Single icon, generate as 'maskable any'
  • Separate icons, generate one as 'any' and the other as 'maskable'

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
Copy link

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 c909a20:

Sandbox Source
basic Configuration

@rishabh3112
Copy link
Owner

@cameronrr Thanks for pull request! It looks great!

@RehanSaeed RehanSaeed merged commit e8e0282 into rishabh3112:master Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants