Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix standalone viewer build via build-app adjustments #786

Merged
merged 7 commits into from
May 9, 2022
Merged

Conversation

paulirish
Copy link
Member

@paulirish paulirish commented Apr 30, 2022

https://googlechrome.github.io/lighthouse-ci/viewer/ is busted
fixes #767

but if you build locally and run your server from inside /packages/viewer/dist its all good. the problem is some root-absolute urls... eg <script src="/script-needed-from-origin-root.js">

anyhow. This appears to be the sleekest solution that keeps both viewer and the server app looking good with no broken references.

i found a lot of weird behavior regarding @chialab/esbuild-plugin-html' and entryNames, assetNames and chunkNames. really weird. filed this one.
but.. ultimately this new usage of that module feels like an improvement over the current status quo.

some development notes

of course the root problem is plenty of 404s.

this is the primary cmd i used to iterate ..

# from viewer folder
find ../../scripts/build-app.js ./src/ui | entr bash -c "rm -rf ../viewer/dist/*; yarn build; tree dist"

path.relative(outdir, stylesheet) :
`/app/${path.relative(outdir, stylesheet)}`;

const htmls = Object.keys(result.metafile.outputs).filter(o => o.endsWith('.html'));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice job untangling that mess

Copy link
Collaborator

@connorjclark connorjclark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for taking care of this

@paulirish
Copy link
Member Author

@connorjclark thx.

these CI tests are just so flaky we give it a few attempts and then just merge anyway?

@paulirish paulirish merged commit 72270e7 into main May 9, 2022
@paulirish paulirish deleted the viewer404s branch May 9, 2022 21:00
@paulirish
Copy link
Member Author

i deployed https://googlechrome.github.io/lighthouse-ci/viewer/ and its lookin good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Viewer assets return 404
2 participants