From 5b96dc354793413478a67b569d7b24db32fae5a1 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Tue, 24 Jun 2025 12:54:39 +0000 Subject: [PATCH] Scope webpack cache by version --- webpack.config.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 1790de6dd..01102cb45 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,7 @@ import process from 'node:process'; import path from 'node:path'; import isDocker from 'is-docker'; +import webpack from 'webpack'; import { serverDirectory } from './src/server-directory.js'; /** @@ -18,7 +19,7 @@ export default function getPublicLibConfig(forceDist = false) { } if (typeof globalThis.DATA_ROOT === 'string') { - return path.resolve(globalThis.DATA_ROOT, '_webpack', 'cache'); + return path.resolve(globalThis.DATA_ROOT, '_webpack', webpack.version, 'cache'); } throw new Error('DATA_ROOT variable is not set.'); @@ -30,7 +31,7 @@ export default function getPublicLibConfig(forceDist = false) { } if (typeof globalThis.DATA_ROOT === 'string') { - return path.resolve(globalThis.DATA_ROOT, '_webpack', 'output'); + return path.resolve(globalThis.DATA_ROOT, '_webpack', webpack.version, 'output'); } throw new Error('DATA_ROOT variable is not set.');