Skip to content

Commit

Permalink
Improve DEBUG parsing: only take care of tailwindcss and not `tailw…
Browse files Browse the repository at this point in the history
…ind` (#6804)

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

* update changelog
  • Loading branch information
RobinMalfait authored Dec 30, 2021
1 parent 10710b0 commit 875c850
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions src/lib/sharedState.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
8 changes: 0 additions & 8 deletions tests/shared-state.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand Down

0 comments on commit 875c850

Please sign in to comment.