From 4cd27e24bb166b67e344a02341e7aaa92038244d Mon Sep 17 00:00:00 2001 From: shlee9999 <95556588+shlee9999@users.noreply.github.com> Date: Sat, 16 Nov 2024 12:31:25 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix:=20lighthouserc=20ouputDir?= =?UTF-8?q?=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/lighthouse.yml | 4 ++-- lighthouserc.cjs | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lighthouse.yml b/.github/workflows/lighthouse.yml index 9e00fc0..91a6394 100644 --- a/.github/workflows/lighthouse.yml +++ b/.github/workflows/lighthouse.yml @@ -46,7 +46,7 @@ jobs: LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} run: | npm install -g @lhci/cli - lhci autorun --collect.settings.chromeFlags="--ignore-certificate-errors --no-sandbox --headless --disable-gpu"|| echo "Fail to Run Lighthouse CI!" + lhci autorun --collect.settings.chromeFlags="--ignore-certificate-errors --no-sandbox --headless --disable-gpu" || echo "Fail to Run Lighthouse CI!" - name: Format lighthouse score id: format_lighthouse_score @@ -55,7 +55,7 @@ jobs: github-token: ${{secrets.GITHUB_TOKEN}} script: | const fs = require('fs'); - const results = JSON.parse(fs.readFileSync("./lhci_reports/manifest.json")); + const results = JSON.parse(fs.readFileSync("./.lighthouseci/manifest.json")); let comments = ""; results.forEach((result) => { const { summary, jsonPath } = result; diff --git a/lighthouserc.cjs b/lighthouserc.cjs index d216926..a2c8549 100644 --- a/lighthouserc.cjs +++ b/lighthouserc.cjs @@ -1,6 +1,7 @@ module.exports = { ci: { collect: { + staticDistDir: './build', numberOfRuns: 1, startServerCommand: 'npm run dev', url: ['https://localhost:3000'], @@ -9,7 +10,9 @@ module.exports = { // preset: 'lighthouse:recommended', // }, upload: { - target: 'temporary-public-storage', + target: 'filesystem', + outputDir: './lhci_reports', + reportFilenamePattern: '%%PATHNAME%%-%%DATETIME%%-report.%%EXTENSION%%', }, }, }