From 8eb6ea6d6c2c0761ec2191a9cf27a37608789fce Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 3 Dec 2020 13:22:42 +0100 Subject: [PATCH] only open links with ios app so you can still create links --- scripts/build.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/scripts/build.js b/scripts/build.js index 4cd2f74..8a04234 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -52,13 +52,14 @@ async function build() { await removeDirIfExists(targetDir); await fs.mkdir(targetDir); await fs.mkdir(path.join(targetDir, "images")); + await fs.mkdir(path.join(targetDir, ".well-known")); const assets = new AssetMap(targetDir); const imageAssets = await copyFolder(path.join(projectDir, "images"), path.join(targetDir, "images")); assets.addSubMap(imageAssets); 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.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(); @@ -141,12 +142,14 @@ function buildAppleAssociatedAppsFile(clients) { return JSON.stringify({ "applinks": { "apps": [], - "details": appIds.map(id => { - return { - "appID": id, - "paths": ["*"] - }; - }), + "details": { + appIDs: appIds, + components: [ + { + "#": "/*", // only open urls with a fragment, so you can still create links + } + ] + }, }, "webcredentials": { "apps": appIds