The short version is... esbuild consuming HTML and css is rough. Parcel treated us well.
in 786 we fixed static serving (the viewer) but made sure the express-based serving (the server) still worked.
it did until it didnt. maybe some dependency bumps? shrug.
But...... this works.
I spent a bunch of time making a more generalized solution. I ended up for something sliiiiightly more specific, but I'm still happy with it.
some development notes
of course the root problem is plenty of because paths. and express (sometimes) but not all the time.
i used these to iterate.
```sh
# from viewer folder
find ../../scripts/build-app.js ./src/ui | entr bash -c "rm -rf ../viewer/dist/*; yarn build; cat dist/index.html"
# from server folder
find ../../scripts/build-app.js package.json src/| entr bash -c "rm -rf ../server/dist*; yarn build:esbuild; bat dist/index.html"
```
Fixes #875
Basically a continuation from last year's https://github.com/GoogleChrome/lighthouse-ci/pull/753 and more specifically https://github.com/GoogleChrome/lighthouse-ci/pull/786
The short version is... esbuild consuming HTML and css is rough. Parcel treated us well.
in 786 we fixed static serving (the viewer) but made sure the express-based serving (the server) still worked. it did until it didnt. maybe some dependency bumps? shrug.
But...... this works. I spent a bunch of time making a more generalized solution. I ended up for something sliiiiightly more specific, but I'm still happy with it.
oh.. and just like in https://github.com/GoogleChrome/lighthouse-ci/pull/786 ...
some development notes
of course the root problem is plenty of because paths. and express (sometimes) but not all the time. i used these to iterate. ```sh # from viewer folder find ../../scripts/build-app.js ./src/ui | entr bash -c "rm -rf ../viewer/dist/*; yarn build; cat dist/index.html" # from server folder find ../../scripts/build-app.js package.json src/| entr bash -c "rm -rf ../server/dist*; yarn build:esbuild; bat dist/index.html" ```