only open links with ios app so you can still create links

This commit is contained in:
Bruno Windels 2020-12-03 13:22:42 +01:00
parent a342293b39
commit 8eb6ea6d6c

View file

@ -52,13 +52,14 @@ async function build() {
await removeDirIfExists(targetDir); await removeDirIfExists(targetDir);
await fs.mkdir(targetDir); await fs.mkdir(targetDir);
await fs.mkdir(path.join(targetDir, "images")); await fs.mkdir(path.join(targetDir, "images"));
await fs.mkdir(path.join(targetDir, ".well-known"));
const assets = new AssetMap(targetDir); const assets = new AssetMap(targetDir);
const imageAssets = await copyFolder(path.join(projectDir, "images"), path.join(targetDir, "images")); const imageAssets = await copyFolder(path.join(projectDir, "images"), path.join(targetDir, "images"));
assets.addSubMap(imageAssets); assets.addSubMap(imageAssets);
await assets.write(`bundle-esm.js`, await buildJs("src/main.js", assets)); await assets.write(`bundle-esm.js`, await buildJs("src/main.js", assets));
await assets.write(`bundle-legacy.js`, await buildJsLegacy("src/main.js", assets, ["src/polyfill.js"])); await assets.write(`bundle-legacy.js`, await buildJsLegacy("src/main.js", assets, ["src/polyfill.js"]));
await assets.write(`bundle.css`, await buildCss("css/main.css", assets)); await assets.write(`bundle.css`, await buildCss("css/main.css", assets));
await assets.writeUnhashed("apple-app-site-association", buildAppleAssociatedAppsFile(createClients())); await assets.writeUnhashed(".well-known/apple-app-site-association", buildAppleAssociatedAppsFile(createClients()));
const globalHash = assets.hashForAll(); const globalHash = assets.hashForAll();
@ -141,12 +142,14 @@ function buildAppleAssociatedAppsFile(clients) {
return JSON.stringify({ return JSON.stringify({
"applinks": { "applinks": {
"apps": [], "apps": [],
"details": appIds.map(id => { "details": {
return { appIDs: appIds,
"appID": id, components: [
"paths": ["*"] {
}; "#": "/*", // only open urls with a fragment, so you can still create links
}), }
]
},
}, },
"webcredentials": { "webcredentials": {
"apps": appIds "apps": appIds