import * as ts from "typescript/lib/tsserverlibrary" ; import * as glob from "glob" ; import * as path from "path" ; see https const CONFIG_GLOB = "**/{tailwind,tailwind.config,tailwind-config,.tailwindrc}.js" ; export function getTailwindConfigPath ( project ) { const projectRootPath = project . getCurrentDirectory ( ) ; const configGlob = path . join ( projectRootPath , CONFIG_GLOB ) ; const [ configPath ] = glob . sync ( configGlob ) ; if ( ! configPath ) { throw new Error ( "Cannot find tailwind config" ) ; } if ( ! project . fileExists ( configPath ) ) { throw new Error ( "Cannot find tailwind config" ) ; } return configPath ; }