From 2713c643651583bb4b4388fe50794e622e51040a Mon Sep 17 00:00:00 2001 From: Brad Cornes Date: Fri, 8 Jan 2021 18:36:34 +0000 Subject: [PATCH] fix fast-glob concurrency --- packages/tailwindcss-intellisense/src/class-names/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/tailwindcss-intellisense/src/class-names/index.js b/packages/tailwindcss-intellisense/src/class-names/index.js index 48c6f30..e8034c4 100644 --- a/packages/tailwindcss-intellisense/src/class-names/index.js +++ b/packages/tailwindcss-intellisense/src/class-names/index.js @@ -10,6 +10,7 @@ import getVariants from './getVariants' import resolveConfig from './resolveConfig' import * as path from 'path' import * as fs from 'fs' +import * as os from 'os' import { getUtilityConfigMap } from './getUtilityConfigMap' import glob from 'fast-glob' import normalizePath from 'normalize-path' @@ -38,6 +39,12 @@ export default async function getClassNames( onlyFiles: true, absolute: true, suppressErrors: true, + // fast-glob defaults concurrency to `os.cpus().length`, + // but this can be 0, so we override it here, ensuring + // that concurrency is at least 1. Fix is here but is + // currently unpublished: + // https://github.com/mrmlnc/fast-glob/pull/296 + concurrency: Math.max(os.cpus().length, 1), }) ) .map(normalizePath)