@@ -25,9 +25,12 @@ function getDefaultExtractor(fileExtension) {
25
25
}
26
26
}
27
27
28
- function getExtractor ( fileName , tailwindConfig ) {
28
+ function getExtractor ( tailwindConfig , fileExtension ) {
29
29
const purgeOptions = tailwindConfig && tailwindConfig . purge && tailwindConfig . purge . options
30
- const fileExtension = path . extname ( fileName ) . slice ( 1 )
30
+
31
+ if ( ! fileExtension ) {
32
+ return ( purgeOptions && purgeOptions . defaultExtractor ) || getDefaultExtractor ( )
33
+ }
31
34
32
35
if ( ! purgeOptions ) {
33
36
return getDefaultExtractor ( fileExtension )
@@ -208,11 +211,16 @@ export default function expandTailwindAtRules(context, registerDependency) {
208
211
env . DEBUG && console . time ( 'Reading changed files' )
209
212
for ( let file of context . changedFiles ) {
210
213
let content = fs . readFileSync ( file , 'utf8' )
211
- let extractor = getExtractor ( file , context . tailwindConfig )
214
+ let extractor = getExtractor ( context . tailwindConfig , path . extname ( file ) . slice ( 1 ) )
212
215
getClassCandidates ( content , extractor , contentMatchCache , candidates , seen )
213
216
}
214
217
env . DEBUG && console . timeEnd ( 'Reading changed files' )
215
218
219
+ for ( let { content, extension } of context . rawContent ) {
220
+ let extractor = getExtractor ( context . tailwindConfig , extension )
221
+ getClassCandidates ( content , extractor , contentMatchCache , candidates , seen )
222
+ }
223
+
216
224
// ---
217
225
218
226
// Generate the actual CSS
0 commit comments