Skip to content

Commit

Permalink
Merge pull request #504 from Condisil/hotfix/503-fix-relative-link
Browse files Browse the repository at this point in the history
replace relative path with configurable
  • Loading branch information
FlorianRappl authored Apr 4, 2022
2 parents 3015b78 + dc0b1df commit 7f9158d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/tooling/piral-cli/src/apps/build-pilet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ interface PiletData {
outDir: string;
}

function createMetadata(outDir: string, outFile: string, pilets: Array<PiletData>) {
function createMetadata(outDir: string, outFile: string, pilets: Array<PiletData>, 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}/`),
})),
);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}"!`);
}
Expand Down

0 comments on commit 7f9158d

Please sign in to comment.