From 103062fbd2901dfc37cea89d87cc36c6cfc7c1c8 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Wed, 26 Jan 2022 18:36:18 +0100 Subject: [PATCH 1/2] ensure content files are available in config If you use the cli with the `--content` option, then we first resolve the config (empty), then add the `content` to the config. The issue is that this means that the content will be empty when you resolve it initially. This results in a warning in your terminal. Now, we will make sure to merge 2 configs if you have the `--content` data passed. We will also make sure to override the final `config.content.files` to whatever you passed in to make sure that this is the same behaviour as before. --- src/cli.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cli.js b/src/cli.js index c8c1fdd2b9cb..67cf3f01daa8 100644 --- a/src/cli.js +++ b/src/cli.js @@ -437,7 +437,6 @@ async function build() { function resolveConfig() { let config = configPath ? require(configPath) : {} - let resolvedConfig = resolveConfigInternal(config) if (args['--purge']) { log.warn('purge-flag-deprecated', [ @@ -450,10 +449,13 @@ async function build() { } if (args['--content']) { - resolvedConfig.content.files = args['--content'].split(/(? Date: Wed, 26 Jan 2022 18:38:54 +0100 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 618170058da2..48381698e4f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- Nothing yet! +### Fixed + +- Remove false positive warning in CLI when using the `--content` option ([#7220](https://github.com/tailwindlabs/tailwindcss/pull/7220)) ## [3.0.16] - 2022-01-24