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 committed 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
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.