Skip to content

10.1.0: Fix broken asset hashing

Compare
Choose a tag to compare
@bensmithett bensmithett released this 05 Apr 23:30
· 38 commits to main since this release
b404a6a

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 and build:server scripts in package.json
  • In prerender.js, switch vite.ssrLoadModule for import and remove references to vite
  • Add the new vite.config.server.js