Some user agents require a <link />
tag with some actual JSON (not JSON-compatible JS module). Unfortunately there seems to be no way to prevent Parcel from converting it into some JS module nonsense.
Completely stock Parcel.
Parcel should leave the file alone, keeping the json
extension, _maybe_ minifying the JSON data itself but nothing more.
Parcel converts the JSON data into a Javascript object and module export and renames the file to .js
.
Please stop converting JSON data.
Trying to get Chrome to read the manifest.json
from the <link rel="manifest" />
tag in an HTML entry point.
manifest.json
{
"foo": "bar"
}
...
<head>
<link rel="manifest" href="manifest.json" />
</head>
...
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.9.7 |
| Node | 8.9.3 |
| npm/Yarn | 5.5.1 |
| Operating System | Alpine Linux (docker) |
This has been a known bug for quite a while, we basically have to detect where it is being required from and handle it differently for html as js.
For manifest you should use .webmanifest
as extension though
For manifest you should use .webmanifest as extension though
Chrome's docs specifically want a manifest.json
.
Any workaround for this?
@serranoarevalo Not that I was aware of. I switched to Rollup.
@Qix- Thanks!
Any news here?
You may want to see #501 , I was able to use the workaround. YMMV
You may want to see #501 , I was able to use the workaround. YMMV
I'm guessing you're referring to the parcel-plugin-json-url-loader workaround? This does not seem to be working for me. Still getting .js output. 馃槩
Most helpful comment
Chrome's docs specifically want a
manifest.json
.