Scope webpack cache by version
| @@ -1,6 +1,7 @@ | |||
| 1 | import process from 'node:process'; | 1 | import process from 'node:process'; |
| 2 | import path from 'node:path'; | 2 | import path from 'node:path'; |
| 3 | import isDocker from 'is-docker'; | 3 | import isDocker from 'is-docker'; |
| 4 | import webpack from 'webpack'; | ||
| 4 | import { serverDirectory } from './src/server-directory.js'; | 5 | import { serverDirectory } from './src/server-directory.js'; |
| 5 | 6 | ||
| 6 | /** | 7 | /** |
| @@ -18,7 +19,7 @@ export default function getPublicLibConfig(forceDist = false) { | |||
| 18 | } | 19 | } |
| 19 | 20 | ||
| 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 | } |
| 23 | 24 | ||
| 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 | } |
| 31 | 32 | ||
| 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 | } |
| 35 | 36 | ||
| 36 | throw new Error('DATA_ROOT variable is not set.'); | 37 | throw new Error('DATA_ROOT variable is not set.'); |