10.1.0: Fix broken asset hashing
Changes
See #44
10.0.0 switched from a 2-step prerender (build the server bundle, then import & use it) to one step (import the Renderer
directly into the prerenderer with vite.ssrLoadModule
)
However as raised in #42, that meant some assets were being referenced by their original name rather than the cacheable hashed name.
This change switches back to the 2-step prerender, while keeping 10.0.0's switch to ES Modules at the project level.
Upgrade instructions (more info)
Merge upstream changes
First, configure this repo as a remote for your repo (you only need to do this once)
git remote add template https://github.com/bensmithett/tropical.git
Then fetch & merge the latest changes, resolving any conflicts manually:
git fetch template
git merge template/master
or...
Manually update your code
Merging upstream changes should be easy for this change, but see https://github.com/bensmithett/tropical/pull/44/files for changes you can make manually:
- Update the
build
andbuild:server
scripts inpackage.json
- In
prerender.js
, switchvite.ssrLoadModule
forimport
and remove references tovite
- Add the new
vite.config.server.js