From daabb4024cbcd985a0da9be464062aec0b81ef4d Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Mon, 4 Aug 2025 17:16:01 +0100 Subject: [PATCH] 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 --- webapp/nuxt.config.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/webapp/nuxt.config.js b/webapp/nuxt.config.js index 206272642..0e047c9bc 100644 --- a/webapp/nuxt.config.js +++ b/webapp/nuxt.config.js @@ -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 */