File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed 
packages/@tailwindcss-vite/src Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -75,19 +75,27 @@ export default function tailwindcss(): Plugin[] {
7575  } 
7676
7777  function  generateCss ( css : string ,  inputPath : string ,  addWatchFile : ( file : string )  =>  void )  { 
78-     let  basePath  =  path . dirname ( path . resolve ( inputPath ) ) 
78+     let  inputBasePath  =  path . dirname ( path . resolve ( inputPath ) ) 
7979
8080    let  {  build,  globs }  =  compile ( css ,  { 
8181      loadPlugin : ( pluginPath )  =>  { 
8282        if  ( pluginPath [ 0 ]  ===  '.' )  { 
83-           return  require ( path . resolve ( basePath ,  pluginPath ) ) 
83+           return  require ( path . resolve ( inputBasePath ,  pluginPath ) ) 
8484        } 
8585
8686        return  require ( pluginPath ) 
8787      } , 
8888    } ) 
8989
90-     let  result  =  scanDir ( {  base : basePath ,  contentPaths : globs  } ) 
90+     let  result  =  scanDir ( { 
91+       // TODO: This might not be necessary if we enable/disabled auto content 
92+       // detection 
93+       base : inputBasePath ,  // Root directory, mainly used for auto content detection 
94+       contentPaths : globs . map ( ( glob )  =>  ( { 
95+         base : inputBasePath ,  // Globs are relative to the input.css file 
96+         glob, 
97+       } ) ) , 
98+     } ) 
9199
92100    for  ( let  candidate  of  result . candidates )  { 
93101      candidates . add ( candidate ) 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments