From c42664cc6fb108d16e6030f2c614b54374412e1e Mon Sep 17 00:00:00 2001 From: Philipp Spiess Date: Mon, 26 Aug 2024 16:59:01 +0200 Subject: [PATCH] Add change log and improve error messages --- CHANGELOG.md | 4 ++++ packages/tailwindcss/src/compat/config/resolve-config.ts | 4 +++- packages/tailwindcss/src/index.ts | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6573eddbb..d3998c1c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add new standalone builds of Tailwind CSS v4 ([#14270](https://github.com/tailwindlabs/tailwindcss/pull/14270)) +### Added + +- Add support for `@config` to load V3 JavaScript config files ([#14239](https://github.com/tailwindlabs/tailwindcss/pull/14239)) + ### Fixed - Bring back type exports for the cjs build of `@tailwindcss/postcss` ([#14256](https://github.com/tailwindlabs/tailwindcss/pull/14256)) diff --git a/packages/tailwindcss/src/compat/config/resolve-config.ts b/packages/tailwindcss/src/compat/config/resolve-config.ts index a6b862dae..85dcb0376 100644 --- a/packages/tailwindcss/src/compat/config/resolve-config.ts +++ b/packages/tailwindcss/src/compat/config/resolve-config.ts @@ -127,7 +127,9 @@ function extractConfigs(ctx: ResolutionContext, { config, path }: ConfigFile): v // Apply configs from presets if (Array.isArray(config.presets) && config.presets.length === 0) { - throw new Error('The empty preset `[]` is not supported') + throw new Error( + 'Error in the config file/plugin/preset. An empty preset (`preset: []`) is not currently supported.', + ) } for (let preset of config.presets ?? []) { diff --git a/packages/tailwindcss/src/index.ts b/packages/tailwindcss/src/index.ts index 1a5580e66..c7f3916c8 100644 --- a/packages/tailwindcss/src/index.ts +++ b/packages/tailwindcss/src/index.ts @@ -342,7 +342,9 @@ async function parseCss( for (let file of resolvedConfig.content.files) { if ('raw' in file) { - throw new Error('raw content is not currently supported') + throw new Error( + `Error in the config file/plugin/preset. The \`content\` key contains a \`raw\` entry:\n\n${JSON.stringify(file, null, 2)}\n\nThis feature is not currently supported.`, + ) } globs.push(file.pattern)