Skip to content

Commit

Permalink
Drop @tailwindcss/line-clamp warning (#10915)
Browse files Browse the repository at this point in the history
* drop `@tailwindcss/line-clamp` check

This won't work in places where `require` calls are hoisted so that
they become static imports. This means that in some projects this
`require` call was breaking the full application even though it was
intentionally put in a try/catch block...

* update changelog
  • Loading branch information
RobinMalfait committed Mar 30, 2023
1 parent 447384b commit 9cd0301
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Try resolving `config.default` before `config` to ensure the config file is resolved correctly ([#10898](https://github.com/tailwindlabs/tailwindcss/pull/10898))
- Pull pseudo elements outside of `:is` and `:has` when using `@apply` ([#10903](https://github.com/tailwindlabs/tailwindcss/pull/10903))
- Update the types for the `safelist` config ([#10901](https://github.com/tailwindlabs/tailwindcss/pull/10901))
- Drop `@tailwindcss/line-clamp` warning ([#10915](https://github.com/tailwindlabs/tailwindcss/pull/10915))

## [3.3.0] - 2023-03-27

Expand Down
17 changes: 0 additions & 17 deletions src/util/normalizeConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,22 +297,5 @@ export function normalizeConfig(config) {
}
}

// Warn if the line-clamp plugin is installed
if (config.plugins.length > 0) {
let plugin
try {
plugin = require('@tailwindcss/line-clamp')
} catch {}

if (plugin && config.plugins.includes(plugin)) {
log.warn('line-clamp-in-core', [
'As of Tailwind CSS v3.3, the `@tailwindcss/line-clamp` plugin is now included by default.',
'Remove it from the `plugins` array in your configuration to eliminate this warning.',
])

config.plugins = config.plugins.filter((p) => p !== plugin)
}
}

return config
}

0 comments on commit 9cd0301

Please sign in to comment.