Parcel: When site.webmanifest file that is not in root directory, icons paths are incorrect

Created on 30 Sep 2019  ยท  5Comments  ยท  Source: parcel-bundler/parcel

๐Ÿ› bug report

  1. Take a look at this project, which builds a simple html file + site.webmanifest with [email protected]
  2. The manifest is at the path static/site.webmanifest (code)
  3. When it gets built, it references the file at /static/site.webmanifest (code)
  4. The "icons" within that file links to the image at test-webmanifest.2044b095.png (code) โ€” which should be relative to the webmanifest inside static/
  5. But the actual image is placed in the root of the dist/ foldr (dist directory)

๐ŸŽ› Configuration (.babelrc, package.json, cli command)

See the above repo.

๐Ÿค” Expected Behavior

I would expect the test-webmanifest.2044b095.png file to end up in the static/ directory.

According to the examples (Google Developers Web App Manifest, MDN Web Manifest) for the manifest of a PWA, the "icons" file paths should include the paths to files.

Albeit, this is different from browser extensions manifests (MDN extension manifest docs)

๐Ÿ˜ฏ Current Behavior

I would expect the test-webmanifest.2044b095.png file is placed in the root of the dist/ directory.

๐Ÿ’ Possible Solution

It seems like linked assets in a webmanifest file should be placed in the proper relative directory.

As a workaround, I just moved everything to the root directory of my static app.

๐Ÿ”ฆ Context

๐Ÿ’ป Code Sample

See the above repo.

๐ŸŒ Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.12.3 |
| Node | 12.9.0 |
| Yarn | 1.6.0 |
| Operating System | OS X 10.14.6 |

Bug

Most helpful comment

Still an issue

All 5 comments

Still an issue

Ran into the same problem.

The issue is related to the wrong build method being use for the webmanifest. If you use 'parcel build' you get the un-minified manifest with path to the un-renamed image. If you use 'parcel' to build on the dev server you get the minified webmanifest with link to the renamed images on the root., I'm guessing there is a '!' missing somewhere.

I'm also getting a minified webmanifest in a subfolder with link to the renamed image on the root.
Should the site.webmanifest be copied to dist/-root (and hashed) on build instead of going into it's own subfolder?

I have index.html at root and site.webmanifest + all other icons in a static-folder.

image

image

image

image

image

image

Ran into the same problem...

Was this page helpful?
0 / 5 - 0 ratings