Skip to content

Commit 60b51d6

Browse files
committed
account for raw content when transforming purgecss options
1 parent df31370 commit 60b51d6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/lib/purgeUnusedStyles.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,15 @@ export default function purgeUnusedUtilities(config, configChanged, resolvedConf
119119
content: (Array.isArray(config.purge)
120120
? config.purge
121121
: config.purge.content || purgeOptions.content || []
122-
).map((pattern) =>
123-
path.resolve(resolvedConfigPath ? path.dirname(resolvedConfigPath) : process.cwd(), pattern)
124-
),
122+
).map((item) => {
123+
if (typeof item === 'string') {
124+
return path.resolve(
125+
resolvedConfigPath ? path.dirname(resolvedConfigPath) : process.cwd(),
126+
item
127+
)
128+
}
129+
return item
130+
}),
125131
}),
126132
])
127133
}

0 commit comments

Comments
 (0)