@@ -112,19 +112,19 @@ 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.
122
+ // If there are no @tailwind or @apply rules, we don't consider this CSS file or it's
123
+ // dependencies to be dependencies of the context. Can reuse the context even if they change.
124
124
// We may want to think about `@layer` being part of this trigger too, but it's tough
125
125
// because it's impossible for a layer in one file to end up in the actual @tailwind rule
126
126
// in another file since independent sources are effectively isolated.
127
- if ( tailwindDirectives . size > 0 ) {
127
+ if ( tailwindDirectives . size > 0 || applyDirectives . size > 0 ) {
128
128
// Add current css file as a context dependencies.
129
129
contextDependencies . add ( result . opts . from )
130
130
@@ -147,12 +147,12 @@ export default function setupTrackingContext(configOrPath) {
147
147
148
148
let candidateFiles = getCandidateFiles ( context , tailwindConfig )
149
149
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.
150
+ // If there are no @tailwind or @apply rules, we don't consider this CSS file or it's
151
+ // dependencies to be dependencies of the context. Can reuse the context even if they change.
152
152
// We may want to think about `@layer` being part of this trigger too, but it's tough
153
153
// because it's impossible for a layer in one file to end up in the actual @tailwind rule
154
154
// in another file since independent sources are effectively isolated.
155
- if ( tailwindDirectives . size > 0 ) {
155
+ if ( tailwindDirectives . size > 0 || applyDirectives . size > 0 ) {
156
156
let fileModifiedMap = getFileModifiedMap ( context )
157
157
158
158
// Add template paths as postcss dependencies.
0 commit comments