File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed
packages/tailwindcss-language-server/src Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 1
1
import type { Plugin } from 'postcss'
2
+ import type { SourcePattern } from '../project-locator'
2
3
3
- export function extractSourceDirectives ( sources : string [ ] ) : Plugin {
4
+ export function extractSourceDirectives ( sources : SourcePattern [ ] ) : Plugin {
4
5
return {
5
6
postcssPlugin : 'extract-at-rules' ,
6
7
AtRule : {
7
8
source : ( { params } ) => {
9
+ let negated = false
10
+
8
11
if ( params [ 0 ] !== '"' && params [ 0 ] !== "'" ) return
9
- sources . push ( params . slice ( 1 , - 1 ) )
12
+
13
+ sources . push ( {
14
+ pattern : params . slice ( 1 , - 1 ) ,
15
+ negated,
16
+ } )
10
17
} ,
11
18
} ,
12
19
}
Original file line number Diff line number Diff line change @@ -623,7 +623,7 @@ async function* contentSelectorsFromCssConfig(
623
623
async function * detectContentFiles (
624
624
base : string ,
625
625
inputFile : string ,
626
- sources : string [ ] ,
626
+ sources : SourcePattern [ ] ,
627
627
resolver : Resolver ,
628
628
) : AsyncIterable < string > {
629
629
try {
@@ -636,10 +636,10 @@ async function* detectContentFiles(
636
636
oxidePath,
637
637
oxideVersion : oxidePackageJson . version ,
638
638
basePath : base ,
639
- sources : sources . map ( ( pattern ) => ( {
639
+ sources : sources . map ( ( source ) => ( {
640
640
base : path . dirname ( inputFile ) ,
641
- pattern,
642
- negated : false ,
641
+ pattern : source . pattern ,
642
+ negated : source . negated ,
643
643
} ) ) ,
644
644
} )
645
645
@@ -673,11 +673,16 @@ type ConfigEntry = {
673
673
content : ContentItem [ ]
674
674
}
675
675
676
+ export interface SourcePattern {
677
+ pattern : string
678
+ negated : boolean
679
+ }
680
+
676
681
class FileEntry {
677
682
content : string | null
678
683
deps : FileEntry [ ] = [ ]
679
684
realpath : string | null
680
- sources : string [ ] = [ ]
685
+ sources : SourcePattern [ ] = [ ]
681
686
meta : TailwindStylesheet | null = null
682
687
683
688
constructor (
You can’t perform that action at this time.
0 commit comments