diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f82ee8592ea..b654143f46d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,8 @@ 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)) +- Fix `@tailwindcss/line-clamp` warning ([#10915](https://github.com/tailwindlabs/tailwindcss/pull/10915), [#10919](https://github.com/tailwindlabs/tailwindcss/pull/10919)) +- Fix `process` is not defined error ([#10919](https://github.com/tailwindlabs/tailwindcss/pull/10919)) ## [3.3.0] - 2023-03-27 diff --git a/src/lib/sharedState.js b/src/lib/sharedState.js index 736a5d8bcc64..1a4a8d5e5b17 100644 --- a/src/lib/sharedState.js +++ b/src/lib/sharedState.js @@ -1,12 +1,21 @@ import pkg from '../../package.json' let OXIDE_DEFAULT_ENABLED = pkg.tailwindcss.engine === 'oxide' -export const env = { - NODE_ENV: process.env.NODE_ENV, - DEBUG: resolveDebug(process.env.DEBUG), - ENGINE: pkg.tailwindcss.engine, - OXIDE: resolveBoolean(process.env.OXIDE, OXIDE_DEFAULT_ENABLED), -} +export const env = + typeof process !== 'undefined' + ? { + NODE_ENV: process.env.NODE_ENV, + DEBUG: resolveDebug(process.env.DEBUG), + ENGINE: pkg.tailwindcss.engine, + OXIDE: resolveBoolean(process.env.OXIDE, OXIDE_DEFAULT_ENABLED), + } + : { + NODE_ENV: 'production', + DEBUG: false, + ENGINE: pkg.tailwindcss.engine, + OXIDE: OXIDE_DEFAULT_ENABLED, + } + export const contextMap = new Map() export const configContextMap = new Map() export const contextSourcesMap = new Map() diff --git a/src/util/validateConfig.js b/src/util/validateConfig.js index 23b4627fbb54..8c22e445035b 100644 --- a/src/util/validateConfig.js +++ b/src/util/validateConfig.js @@ -9,5 +9,18 @@ export function validateConfig(config) { ]) } + // Warn if the line-clamp plugin is installed + try { + let plugin = require('@tailwindcss/line-clamp') + if (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) + } + } catch {} + return config }