Improve DEBUG parsing: only take care of tailwindcss and not tailwind (#6804)

* only take care of `tailwindcss` and not `tailwind`

* update changelog
This commit is contained in:
Robin Malfait 2021-12-30 16:41:23 +01:00 committed by GitHub
parent 10710b08b9
commit 875c850b37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 13 deletions

View File

@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Improve `DEBUG` flag ([#6797](https://github.com/tailwindlabs/tailwindcss/pull/6797))
- Improve `DEBUG` flag ([#6797](https://github.com/tailwindlabs/tailwindcss/pull/6797), [#6804](https://github.com/tailwindlabs/tailwindcss/pull/6804))
## [3.0.8] - 2021-12-28

View File

@ -35,13 +35,13 @@ export function resolveDebug(debug) {
let debuggers = debug.split(',').map((d) => d.split(':')[0])
// Ignoring tailwind / tailwindcss
if (debuggers.includes('-tailwindcss') || debuggers.includes('-tailwind')) {
// Ignoring tailwindcss
if (debuggers.includes('-tailwindcss')) {
return false
}
// Definitely including tailwind / tailwindcss
if (debuggers.includes('tailwindcss') || debuggers.includes('tailwind')) {
// Including tailwindcss
if (debuggers.includes('tailwindcss')) {
return true
}

View File

@ -7,20 +7,12 @@ it.each`
${'false'} | ${false}
${'0'} | ${false}
${'*'} | ${true}
${'tailwind'} | ${true}
${'tailwind:*'} | ${true}
${'tailwindcss'} | ${true}
${'tailwindcss:*'} | ${true}
${'other,tailwind'} | ${true}
${'other,tailwind:*'} | ${true}
${'other,tailwindcss'} | ${true}
${'other,tailwindcss:*'} | ${true}
${'other,-tailwind'} | ${false}
${'other,-tailwind:*'} | ${false}
${'other,-tailwindcss'} | ${false}
${'other,-tailwindcss:*'} | ${false}
${'-tailwind'} | ${false}
${'-tailwind:*'} | ${false}
${'-tailwindcss'} | ${false}
${'-tailwindcss:*'} | ${false}
`('should resolve the debug ($value) flag correctly ($expected)', ({ value, expected }) => {