From 329bc51e1033f80205d2725d2c054d38362a7217 Mon Sep 17 00:00:00 2001 From: gusthoff Date: Sat, 6 Jun 2026 02:07:41 +0200 Subject: [PATCH 1/2] Frontend: switch webpack output filenames from [fullhash] to [contenthash] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace [fullhash] with [contenthash] in all three places in webpack.common.cjs: - output.filename: '[name].[fullhash].js' → '[name].[contenthash].js' - MiniCssExtractPlugin filename: '[name].[fullhash].css' → '[name].[contenthash].css' - font_rule name option: '[name].[ext]?[fullhash]' → '[name].[ext]?[contenthash]' [fullhash] is a build-level hash — it rotates every filename whenever any module changes. [contenthash] is a per-chunk hash that only changes when the content of that specific chunk changes. Unchanged chunks therefore keep their filename across releases, improving CDN and browser cache hit rate. --- frontend/webpack.common.cjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/webpack.common.cjs b/frontend/webpack.common.cjs index 93c569ec4..c36603399 100644 --- a/frontend/webpack.common.cjs +++ b/frontend/webpack.common.cjs @@ -75,7 +75,7 @@ const css_rule = function(env) { const font_rule = function(env) { const fontloader_opts = { - name: '[name].[ext]?[fullhash]', + name: '[name].[ext]?[contenthash]', outputPath: 'fonts/', publicPath: '/_static/fonts/' }; @@ -107,7 +107,7 @@ module.exports = function(env) { return { entry: './src/index.ts', output: { - filename: '[name].[fullhash].js', + filename: '[name].[contenthash].js', path: path.resolve(__dirname, 'dist', 'html', '_static') }, resolve: { @@ -135,7 +135,7 @@ module.exports = function(env) { plugins: [ new CleanWebpackPlugin(), new MiniCssExtractPlugin({ - filename: '[name].[fullhash].css', + filename: '[name].[contenthash].css', }), new Chunks2JsonPlugin(), new ESLintPlugin(myEslintOptions), From 76f43a1c86b420958769b652764fb5aa184e49a8 Mon Sep 17 00:00:00 2001 From: gusthoff Date: Sat, 6 Jun 2026 02:08:17 +0200 Subject: [PATCH 2/2] Frontend: enable webpack persistent filesystem cache Add a cache block to webpack.common.cjs: cache: { type: 'filesystem', buildDependencies: { config: [__filename], }, }, webpack 5's filesystem cache serializes the resolved module graph to node_modules/.cache/webpack/ after a cold build. Subsequent builds restore from that cache, skipping module resolution and giving a significant warm-build speedup for local development and CI (when the cache directory is restored between runs). The buildDependencies.config entry ensures that any change to webpack.common.cjs itself (or its transitive require()s) invalidates the cache and forces a full rebuild, preventing stale cache hits after config changes. The cache directory is already covered by the node_modules entry in frontend/.gitignore, so no .gitignore change is needed. --- frontend/webpack.common.cjs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/webpack.common.cjs b/frontend/webpack.common.cjs index c36603399..b17ea024a 100644 --- a/frontend/webpack.common.cjs +++ b/frontend/webpack.common.cjs @@ -120,6 +120,13 @@ module.exports = function(env) { } }, + cache: { + type: 'filesystem', + buildDependencies: { + config: [__filename], + }, + }, + module: { rules: [ ts_rule(env),