harlan-zw / unlighthouse

Scan your entire site with Google Lighthouse in 2 minutes (on average). Open source, fully configurable with minimal setup.
https://unlighthouse.dev
MIT License
3.88k stars 115 forks source link

Allow relative paths in reports, for when the path to be published is complex and variable. #244

Closed juanjol closed 1 month ago

juanjol commented 1 month ago

Clear and concise description of the problem

Hi, although this may seem like a duplicate of #201 and #192 , I wanted to comment on my case to see if there is a possible solution that does not involve a massive replacement of the routes.

I'm implementing unlighthouse in a Jenkins process, where we publish the report as a browsable artifact. This means that the report ends up in a complex (multi-level) route that changes with each execution of the job. The routerPrefix option seems like a great solution for fixed urls, but in this case we can't predict the final path in a simple way, so our approach was that the path to the assets should be relative, something like ‘assets/’ or ‘./assets/’, but from what I've seen routerPrefix always ends up adding an slash in front of it.

Is there any way to make the paths relative?

Suggested solution

Add an option in config to allow relative routes, routerRelative maybe?``

Alternative

No response

Additional context

No response

harlan-zw commented 1 month ago

Hi, if you provide no routerPrefix is will now attempt to load anything relative form the path its served.