fix(webapp): invalidate cache (#8763)

* invalidate cache by attaching the ocelot version in the js chuck filenames

* petter adjust js chunk name to the nuxt default, also attach version to css files
This commit is contained in:
Ulf Gebhardt 2025-08-04 17:16:01 +01:00 committed by GitHub
parent 754efa5197
commit daabb4024c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -244,11 +244,20 @@ export default {
},
manifest,
/*
** Build configuration
*/
build: {
// Invalidate cache between versions
// https://www.reddit.com/r/Nuxt/comments/18i8hp2/comment/kdc1wa3/
// https://v2.nuxt.com/docs/configuration-glossary/configuration-build/#filenames
filenames: {
chunk: ({ isDev, isModern }) =>
isDev
? `[name]${isModern ? '.modern' : ''}.js`
: `[contenthash:7]${isModern ? '.modern' : ''}_${CONFIG.VERSION}.js`,
css: ({ isDev }) => (isDev ? '[name].css' : `css/[contenthash:7]_${CONFIG.VERSION}.css`),
},
/*
** You can extend webpack config here
*/