@@ -112,19 +112,20 @@ function resolveChangedFiles(candidateFiles, fileModifiedMap) {
112
112
// source path), or set up a new one (including setting up watchers and registering
113
113
// plugins) then return it
114
114
export default function setupTrackingContext ( configOrPath ) {
115
- return ( { tailwindDirectives, registerDependency } ) => {
115
+ return ( { tailwindDirectives, registerDependency, applyDirectives } ) => {
116
116
return ( root , result ) => {
117
117
let [ tailwindConfig , userConfigPath , tailwindConfigHash , configDependencies ] =
118
118
getTailwindConfig ( configOrPath )
119
119
120
120
let contextDependencies = new Set ( configDependencies )
121
121
122
- // If there are no @tailwind rules, we don't consider this CSS file or it's dependencies
123
- // to be dependencies of the context. Can reuse the context even if they change.
124
- // We may want to think about `@layer` being part of this trigger too, but it's tough
125
- // because it's impossible for a layer in one file to end up in the actual @tailwind rule
126
- // in another file since independent sources are effectively isolated.
127
- if ( tailwindDirectives . size > 0 ) {
122
+ // If there are no @tailwind or @apply rules, we don't consider this CSS
123
+ // file or its dependencies to be dependencies of the context. Can reuse
124
+ // the context even if they change. We may want to think about `@layer`
125
+ // being part of this trigger too, but it's tough because it's impossible
126
+ // for a layer in one file to end up in the actual @tailwind rule in
127
+ // another file since independent sources are effectively isolated.
128
+ if ( tailwindDirectives . size > 0 || applyDirectives . size > 0 ) {
128
129
// Add current css file as a context dependencies.
129
130
contextDependencies . add ( result . opts . from )
130
131
@@ -147,12 +148,12 @@ export default function setupTrackingContext(configOrPath) {
147
148
148
149
let candidateFiles = getCandidateFiles ( context , tailwindConfig )
149
150
150
- // If there are no @tailwind rules, we don't consider this CSS file or it's dependencies
151
- // to be dependencies of the context. Can reuse the context even if they change.
151
+ // If there are no @tailwind or @apply rules, we don't consider this CSS file or it's
152
+ // dependencies to be dependencies of the context. Can reuse the context even if they change.
152
153
// We may want to think about `@layer` being part of this trigger too, but it's tough
153
154
// because it's impossible for a layer in one file to end up in the actual @tailwind rule
154
155
// in another file since independent sources are effectively isolated.
155
- if ( tailwindDirectives . size > 0 ) {
156
+ if ( tailwindDirectives . size > 0 || applyDirectives . size > 0 ) {
156
157
let fileModifiedMap = getFileModifiedMap ( context )
157
158
158
159
// Add template paths as postcss dependencies.
0 commit comments