@@ -71,7 +71,7 @@ export async function getTailwindConfig(options: ParserOptions): Promise<any> {
71
71
// For the same reasons as the v4 stylesheet, it's important that the config
72
72
// file be resolved relative to the file it's configured in.
73
73
if ( ! stylesheet && ! mod ?. __unstable__loadDesignSystem ) {
74
- let jsConfig = resolveJsConfigPath ( options , configDir )
74
+ let jsConfig = resolveJsConfigPath ( options , configDir , inputDir )
75
75
if ( jsConfig ) {
76
76
return pathToApiMap . remember ( `${ pkgDir } :${ jsConfig } ` , ( ) => loadV3 ( pkgDir , jsConfig ) )
77
77
}
@@ -141,18 +141,18 @@ async function resolveTailwindPath(options: ParserOptions, baseDir: string): Pro
141
141
}
142
142
143
143
let configPathCache = new Map < string , string | null > ( )
144
- function resolveJsConfigPath ( options : ParserOptions , configDir : string ) : string | null {
144
+ function resolveJsConfigPath ( options : ParserOptions , configDir : string , inputDir : string ) : string | null {
145
145
if ( options . tailwindConfig ) {
146
146
if ( options . tailwindConfig . endsWith ( '.css' ) ) return null
147
147
148
148
return path . resolve ( configDir , options . tailwindConfig )
149
149
}
150
150
151
- let configPath : string | null | undefined = configPathCache . get ( configDir )
151
+ let configPath : string | null | undefined = configPathCache . get ( inputDir )
152
152
153
153
if ( configPath === undefined ) {
154
154
try {
155
- let foundPath = escalade ( configDir , ( _ , names ) => {
155
+ let foundPath = escalade ( inputDir , ( _ , names ) => {
156
156
if ( names . includes ( 'tailwind.config.js' ) ) return 'tailwind.config.js'
157
157
if ( names . includes ( 'tailwind.config.cjs' ) ) return 'tailwind.config.cjs'
158
158
if ( names . includes ( 'tailwind.config.mjs' ) ) return 'tailwind.config.mjs'
@@ -163,7 +163,7 @@ function resolveJsConfigPath(options: ParserOptions, configDir: string): string
163
163
} catch { }
164
164
165
165
configPath ??= null
166
- configPathCache . set ( configDir , configPath )
166
+ configPathCache . set ( inputDir , configPath )
167
167
}
168
168
169
169
return configPath
0 commit comments