Skip to content

Commit f79b5c2

Browse files
committed
Improve PurgeCSS warning
1 parent 4e5be9c commit f79b5c2

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/lib/purgeUnusedStyles.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,20 @@ export default function purgeUnusedUtilities(config) {
3636
// Skip if `purge: []` since that's part of the default config
3737
if (Array.isArray(config.purge) && config.purge.length === 0) {
3838
log()
39-
log(emoji.warning, chalk.yellow(' Skipping purge because no template paths provided.'))
40-
log(chalk.white(' To silence this warning, set `purge: false` in your Tailwind config file.'))
39+
log(
40+
emoji.warning,
41+
chalk.yellow(
42+
' Tailwind is not purging unused styles because no template paths have been provided.'
43+
)
44+
)
45+
log(
46+
chalk.white(
47+
' If you have manually configured PurgeCSS outside of Tailwind or are deliberately not\n removing unused styles, set `purge: false` in your Tailwind config file to silence\n this warning.'
48+
)
49+
)
50+
log(
51+
chalk.white('\n https://tailwindcss.com/docs/controlling-file-size/#removing-unused-css')
52+
)
4153
return removeTailwindComments
4254
}
4355

0 commit comments

Comments
 (0)