Skip to content

Commit

Permalink
fix(insight): use relative path (#5399)
Browse files Browse the repository at this point in the history
  • Loading branch information
intellix authored Nov 4, 2023
1 parent 1e36f23 commit 1d71aec
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/qwik-labs/src-vite/insights/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ export async function qwikInsights(qwikInsightsOpts: {
} catch (e) {
logWarn('fail to fetch manifest from Insights DB');
}
if (!existsSync(join(process.cwd(), outDir))) {
mkdirSync(join(process.cwd(), outDir), { recursive: true });
const cwdRelativePath = join(viteConfig.root || '.', outDir);
const cwdRelativePathJson = join(cwdRelativePath, 'q-insights.json');
if (!existsSync(join(process.cwd(), cwdRelativePath))) {
mkdirSync(join(process.cwd(), cwdRelativePath), { recursive: true });
}
const cwdRelativePath = join(viteConfig.root || '.', outDir, 'q-insights.json');
log('Fetched latest Qwik Insight data into: ' + cwdRelativePath);
await writeFile(join(process.cwd(), cwdRelativePath), JSON.stringify(qManifest));
log('Fetched latest Qwik Insight data into: ' + cwdRelativePathJson);
await writeFile(join(process.cwd(), cwdRelativePathJson), JSON.stringify(qManifest));
}
},
closeBundle: async () => {
Expand Down

0 comments on commit 1d71aec

Please sign in to comment.