diff --git a/src/TaskRunner.js b/src/TaskRunner.js index 82e6664e..2c625b6b 100644 --- a/src/TaskRunner.js +++ b/src/TaskRunner.js @@ -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 };