Scope webpack cache by version

5b96dc354793413478a67b569d7b24db32fae5a1

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +3 -2Showing whitespace changes
webpack.config.js+3 -2
@@ -1,6 +1,7 @@
1import process from 'node:process';1import process from 'node:process';
2import path from 'node:path';2import path from 'node:path';
3import isDocker from 'is-docker';3import isDocker from 'is-docker';
4import webpack from 'webpack';
4import { serverDirectory } from './src/server-directory.js';5import { serverDirectory } from './src/server-directory.js';
56
6/**7/**
@@ -18,7 +19,7 @@ export default function getPublicLibConfig(forceDist = false) {
18 }19 }
1920
20 if (typeof globalThis.DATA_ROOT === 'string') {21 if (typeof globalThis.DATA_ROOT === 'string') {
21 return path.resolve(globalThis.DATA_ROOT, '_webpack', 'cache');22 return path.resolve(globalThis.DATA_ROOT, '_webpack', webpack.version, 'cache');
22 }23 }
2324
24 throw new Error('DATA_ROOT variable is not set.');25 throw new Error('DATA_ROOT variable is not set.');
@@ -30,7 +31,7 @@ export default function getPublicLibConfig(forceDist = false) {
30 }31 }
3132
32 if (typeof globalThis.DATA_ROOT === 'string') {33 if (typeof globalThis.DATA_ROOT === 'string') {
33 return path.resolve(globalThis.DATA_ROOT, '_webpack', 'output');34 return path.resolve(globalThis.DATA_ROOT, '_webpack', webpack.version, 'output');
34 }35 }
3536
36 throw new Error('DATA_ROOT variable is not set.');37 throw new Error('DATA_ROOT variable is not set.');