@@ -7,13 +7,29 @@ import locatePath from 'locate-path'
77
88import type { Configuration } from 'twind'
99
10- const CONFIG_FILES = [ 'twind.config.ts' , 'twind.config.mjs' , 'twind.config.js' , 'twind.config.cjs' ]
10+ const TWIND_CONFIG_FILES = [
11+ 'twind.config.ts' ,
12+ 'twind.config.mjs' ,
13+ 'twind.config.js' ,
14+ 'twind.config.cjs' ,
15+ ]
1116
17+ const TAILWIND_CONFIG_FILES = [
18+ 'tailwind.config.ts' ,
19+ 'tailwind.config.mjs' ,
20+ 'tailwind.config.js' ,
21+ 'tailwind.config.cjs' ,
22+ ]
23+
24+ // TODO use typescript to check files
25+ // this.typescript.server.toNormalizedPath(fileName)
26+ // info.project.containsFile()
1227export const findConfig = ( cwd = process . cwd ( ) ) : string | undefined =>
13- locatePath . sync ( CONFIG_FILES . map ( ( file ) => Path . resolve ( cwd , 'config' , file ) ) ) ||
14- locatePath . sync ( CONFIG_FILES . map ( ( file ) => Path . resolve ( cwd , 'src' , file ) ) ) ||
15- locatePath . sync ( CONFIG_FILES . map ( ( file ) => Path . resolve ( cwd , 'public' , file ) ) ) ||
16- findUp . sync ( CONFIG_FILES , { cwd } )
28+ locatePath . sync ( TWIND_CONFIG_FILES . map ( ( file ) => Path . resolve ( cwd , 'config' , file ) ) ) ||
29+ locatePath . sync ( TWIND_CONFIG_FILES . map ( ( file ) => Path . resolve ( cwd , 'src' , file ) ) ) ||
30+ locatePath . sync ( TWIND_CONFIG_FILES . map ( ( file ) => Path . resolve ( cwd , 'public' , file ) ) ) ||
31+ findUp . sync ( TWIND_CONFIG_FILES , { cwd } ) ||
32+ findUp . sync ( TAILWIND_CONFIG_FILES , { cwd } )
1733
1834export const loadConfig = ( configFile : string , cwd = process . cwd ( ) ) : Configuration => {
1935 const result = buildSync ( {
0 commit comments