Open jsonsivar opened 4 years ago
I added this snippet in a local project and it seemed to have cleared the manifest file:
exports.onPostBuild = async ({ reporter }) => {
// replace prefix paths for manifest file
const path = 'public/manifest.webmanifest';
const buffer = await readFileAsync(path);
let contents = buffer.toString();
if (!contents.includes('__GATSBY_IPFS_PATH_PREFIX__')) {
return;
}
contents = contents
.replace("\"/__GATSBY_IPFS_PATH_PREFIX__\"", "\"/\"")
.replace(/\/__GATSBY_IPFS_PATH_PREFIX__\//g, "/");
await writeFileAsync(path, contents);
}
Currently the manifest file is not getting the prefix replaced. I think it's safe just to remove it since it's already relative. Looking at this line, it looks like if we add a special case for a
.webmanifest
file that removes it the URLs for the icons should be fine.Let me know if that makes sense, I can try creating a PR for it if you think that's the right direction.