From dc0b1dffb34cdb42abefafa59738e5bdf2c4cb19 Mon Sep 17 00:00:00 2001 From: Lucas Braeschke Date: Mon, 4 Apr 2022 08:17:52 +0200 Subject: [PATCH] replace relative path with configurable --- src/tooling/piral-cli/src/apps/build-pilet.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tooling/piral-cli/src/apps/build-pilet.ts b/src/tooling/piral-cli/src/apps/build-pilet.ts index 621b6541a..990ce01d9 100644 --- a/src/tooling/piral-cli/src/apps/build-pilet.ts +++ b/src/tooling/piral-cli/src/apps/build-pilet.ts @@ -31,14 +31,14 @@ interface PiletData { outDir: string; } -function createMetadata(outDir: string, outFile: string, pilets: Array) { +function createMetadata(outDir: string, outFile: string, pilets: Array, publicPath: string) { return writeJson( outDir, outFile, pilets.map((p) => ({ name: p.package.name, version: p.package.version, - link: `./${p.id}/${p.outFile}`, + link: `${publicPath}${p.id}/${p.outFile}`, ...getPiletSpecMeta(p.path, `./${p.id}/`), })), ); @@ -279,7 +279,7 @@ export async function buildPilet(baseDir = process.cwd(), options: BuildPiletOpt await copyPilets(outDir, pilets); - await createMetadata(outDir, '$pilet-api', pilets); + await createMetadata(outDir, '$pilet-api', pilets, '/'); if (isEmulator) { // in case of an emulator assets are not "seen" by the bundler, so we @@ -322,7 +322,7 @@ export async function buildPilet(baseDir = process.cwd(), options: BuildPiletOpt await copyPilets(outDir, pilets); - await createMetadata(outDir, manifest, pilets); + await createMetadata(outDir, manifest, pilets, '/'); logDone(`Manifest available at "${outDir}/${manifest}"!`); }