@@ -200,9 +200,11 @@ type ProjectConfig = {
200
200
folder : string
201
201
configPath ?: string
202
202
documentSelector ?: Array < DocumentSelector >
203
+ isUserConfigured : boolean
203
204
}
204
205
205
206
enum DocumentSelectorPriority {
207
+ USER_CONFIGURED = 0 ,
206
208
CONFIG_FILE = 0 ,
207
209
CSS_FILE = 0 ,
208
210
CONTENT_FILE = 1 ,
@@ -448,7 +450,11 @@ async function createProjectService(
448
450
if ( ! isConfigFile && ! isDependency && ! isPackageFile ) continue
449
451
450
452
if ( ! enabled ) {
451
- if ( projectConfig . configPath && ( isConfigFile || isDependency ) ) {
453
+ if (
454
+ ! projectConfig . isUserConfigured &&
455
+ projectConfig . configPath &&
456
+ ( isConfigFile || isDependency )
457
+ ) {
452
458
documentSelector = [
453
459
...documentSelector . filter (
454
460
( { priority } ) => priority !== DocumentSelectorPriority . CONTENT_FILE
@@ -959,17 +965,19 @@ async function createProjectService(
959
965
}
960
966
961
967
/////////////////////
962
- documentSelector = [
963
- ...documentSelector . filter (
964
- ( { priority } ) => priority !== DocumentSelectorPriority . CONTENT_FILE
965
- ) ,
966
- ...getContentDocumentSelectorFromConfigFile (
967
- state . configPath ,
968
- tailwindcss . version ,
969
- projectConfig . folder ,
970
- originalConfig
971
- ) ,
972
- ]
968
+ if ( ! projectConfig . isUserConfigured ) {
969
+ documentSelector = [
970
+ ...documentSelector . filter (
971
+ ( { priority } ) => priority !== DocumentSelectorPriority . CONTENT_FILE
972
+ ) ,
973
+ ...getContentDocumentSelectorFromConfigFile (
974
+ state . configPath ,
975
+ tailwindcss . version ,
976
+ projectConfig . folder ,
977
+ originalConfig
978
+ ) ,
979
+ ]
980
+ }
973
981
//////////////////////
974
982
975
983
try {
@@ -1610,9 +1618,10 @@ class TW {
1610
1618
folder : base ,
1611
1619
configPath : path . resolve ( base , relativeConfigPath ) ,
1612
1620
documentSelector : [ ] . concat ( relativeDocumentSelectorOrSelectors ) . map ( ( selector ) => ( {
1613
- priority : DocumentSelectorPriority . CONTENT_FILE ,
1621
+ priority : DocumentSelectorPriority . USER_CONFIGURED ,
1614
1622
pattern : path . resolve ( base , selector ) ,
1615
1623
} ) ) ,
1624
+ isUserConfigured : true ,
1616
1625
}
1617
1626
}
1618
1627
)
@@ -1706,6 +1715,7 @@ class TW {
1706
1715
return {
1707
1716
folder : base ,
1708
1717
configPath,
1718
+ isUserConfigured : false ,
1709
1719
documentSelector : documentSelector
1710
1720
. sort ( ( a , z ) => a . priority - z . priority )
1711
1721
. filter (
0 commit comments