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 static subresource paths for server/viewer #879

Merged
merged 4 commits into from
Mar 3, 2023

Conversation

paulirish
Copy link
Member

@paulirish paulirish commented Mar 3, 2023

Fixes #875

Basically a continuation from last year's #753 and more specifically #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 #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.

# 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"

Verified

This commit was signed with the committer’s verified signature.
javsalgar Javier J. Salmerón García
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.

CSS chunk is served with incorrect Content-Type header
2 participants