Skip to content

Commit 3cdd2ed

Browse files
authoredMay 14, 2019
fix: fallback for cache directory (#86)
1 parent 2388f2a commit 3cdd2ed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎src/TaskRunner.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ export default class TaskRunner {
1313
constructor(options = {}) {
1414
const { cache, parallel } = options;
1515
this.cacheDir =
16-
cache === true ? findCacheDir({ name: 'terser-webpack-plugin' }) : cache;
16+
cache === true
17+
? findCacheDir({ name: 'terser-webpack-plugin' }) || os.tmpdir()
18+
: cache;
1719
// In some cases cpus() returns undefined
1820
// https://github.com/nodejs/node/issues/19022
1921
const cpus = os.cpus() || { length: 1 };

0 commit comments

Comments
 (0)
Please sign in to comment.