maintenace: upgrade vite to version 5 #113
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Vite is on version 6, but firebird has been on v4. This updates firebird to version 5, which is a step in the right direction!
Vite 5 changed how it outputs the build manifest, which had downstream effects on every HT front-end application.
manifest.json
The current prod manifest looks like this
and v5 was giving something like
Honestly, I like the new version and it makes more sense to me! But our applications are looking for specific file names, and it's easier to fix it in firebird than rename scripts in every other application.
Adding
cssCodeSplit: false
to the config breaks the css file into its own object:But then I tinkered some more with the config file to replace
style.css
withindex.css
:output
option to the rollup section of the config that renames the build/compiled css file fromstyle.css
(v5) toindex.css
(to match v4)postbuild-commands
) that hooks into the closeBundle function and replaces a differentstyle.css
withindex.css
Which spits out this manifest in the end:
The manifest was looking great, but the storybook build was upset about the vite config changes, so I filtered the plugins in the storybook config to not use that
postbuild-commands
plugin.I tested this on dev-3 and it's working! I'm not sure there's anything to test here, just looking for a second set of eyes!
Edit to add: There was a testing error where
vitest
couldn't findhappy-dom
, so I upgradedvitest
,vitest/coverage-istanbul
, and addedhappy-dom
as a dev dependency.