Skip to content

Commit e8faf57

Browse files
fix: add fallback to transform cache directory
1 parent eaf4306 commit e8faf57

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/postProcessPattern.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import path from 'path';
2-
2+
import os from 'os';
33
import crypto from 'crypto';
44

55
import loaderUtils from 'loader-utils';
@@ -53,9 +53,10 @@ export default function postProcessPattern(globalRef, pattern, file) {
5353

5454
if (pattern.cache) {
5555
if (!globalRef.cacheDir) {
56-
globalRef.cacheDir = findCacheDir({
57-
name: 'copy-webpack-plugin',
58-
});
56+
globalRef.cacheDir =
57+
findCacheDir({
58+
name: 'copy-webpack-plugin',
59+
}) || os.tmpdir();
5960
}
6061

6162
const cacheKey = pattern.cache.key

0 commit comments

Comments
 (0)