Skip to content

Commit

Permalink
fix: fallback for cache directory (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored May 14, 2019
1 parent 2388f2a commit 3cdd2ed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/TaskRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export default class TaskRunner {
constructor(options = {}) {
const { cache, parallel } = options;
this.cacheDir =
cache === true ? findCacheDir({ name: 'terser-webpack-plugin' }) : cache;
cache === true
? findCacheDir({ name: 'terser-webpack-plugin' }) || os.tmpdir()
: cache;
// In some cases cpus() returns undefined
// https://github.com/nodejs/node/issues/19022
const cpus = os.cpus() || { length: 1 };
Expand Down

0 comments on commit 3cdd2ed

Please sign in to comment.