rishabh3112 / gridsome-plugin-pwa

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

Incorrect path of msapplication-TileImage #48

Closed hendrikbursian closed 4 years ago

hendrikbursian commented 4 years ago

While checking for broken links with hyperlink after I build my website, I noticed that the path for the msapplication-TileImage is broken no matter the configuration.

hyperlink output

...
not ok 2 load dist/assets/static/favicon.png-144x144.png
  ---
    operator: load
    expected:
      "200 dist/assets/static/favicon.png-144x144.png"
    actual:
      "ENOENT: no such file or directory, open '[HIDDEN]/dist/assets/static/favicon.png-144x144.png'"
    at: dist/index.html:4:987 <meta data-vue-tag="ssr" name="msapplication-TileImage" content="/assets/static/favicon.png-144x144.png">
...

The generated path is dist/assets/static/favicon.png-144x144.png but it should be dist/assets/static/favicon-144x144.png.

I looked up the code that generates the path and found what is wrong with it:

  const iconsDir = 'assets/static/';
  const iconName = options.icon.split('/').slice(-1)[0]; // <-- Here the whole filename is taken (i.e. "favicon.png")
  const msTileImage = `/${iconsDir}${iconName}-144x144.png`; // Which then results in "/assets/static/favicon.png-144x144.png", instead of "/assets/static/favicon-144x144.png"

source

hendrikbursian commented 4 years ago

I'm already working on a fix, it would be nice if you could merge it, if I did not overlook somethting major here :)

rishabh3112 commented 4 years ago

Thanks for pull request!