Skip to content

Commit

Permalink
misc: tweak folder used for vercel deployment (#12879)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark authored Aug 13, 2021
1 parent c23fff1 commit 084d436
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions build/build-sample-reports.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const {LH_ROOT} = require('../root.js');
const htmlReportAssets = require('../lighthouse-core/../report/report-assets.js');


const DIST = path.join(LH_ROOT, `dist/now`);
const DIST = path.join(LH_ROOT, 'dist');

(async function() {
addPluginCategory(lhr);
Expand Down Expand Up @@ -47,8 +47,7 @@ const DIST = path.join(LH_ROOT, `dist/now`);
// - a more constrained/realistic default size
html = html.replace(`"lh-root lh-vars"`, `"lh-root lh-vars lh-devtools"`);
}

const filepath = `${DIST}/${variant}${filename}/index.html`;
const filepath = `${DIST}/sample-reports/${variant}${filename}/index.html`;
fs.mkdirSync(path.dirname(filepath), {recursive: true});
fs.writeFileSync(filepath, html, {encoding: 'utf-8'});
console.log('✅', filepath, 'written.');
Expand Down
5 changes: 2 additions & 3 deletions lighthouse-core/scripts/dogfood-lhci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,13 @@ if ! echo "$CHANGED_FILES" | grep -E 'report|lhci' > /dev/null; then
exit 0
fi

# Generate HTML reports in ./dist/now/
yarn build-report
# Generate HTML reports in ./dist/sample-reports
yarn vercel-build

# Install LHCI
npm install -g @lhci/cli@next
# Collect our LHCI results.
lhci collect --staticDistDir=./dist/now/english/
lhci collect --staticDistDir=./dist/sample-reports/english
# Upload the results to our canary server.
lhci upload \
--serverBaseUrl="$LHCI_CANARY_SERVER_URL" \
Expand Down
2 changes: 1 addition & 1 deletion now.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"src": "package.json",
"use": "@now/static-build",
"config": {"distDir": "dist/now"}
"config": {"distDir": "dist"}
}
],
"github": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"fast": "node ./lighthouse-cli/index.js --preset=desktop --throttlingMethod=provided",
"deploy-treemap": "yarn build-treemap --deploy",
"deploy-viewer": "yarn build-viewer --deploy",
"vercel-build": "yarn build-sample-reports && yarn build-viewer && yarn build-treemap && cp -r dist/gh-pages dist/now/gh-pages",
"vercel-build": "yarn build-sample-reports && yarn build-viewer && yarn build-treemap",
"dogfood-lhci": "./lighthouse-core/scripts/dogfood-lhci.sh",
"timing-trace": "node lighthouse-core/scripts/generate-timing-trace.js",
"changelog": "conventional-changelog --config ./build/changelog-generator/index.js --infile changelog.md --same-file",
Expand Down

0 comments on commit 084d436

Please sign in to comment.