From 8a0b5ca263371efa6f3014e960ae1942fa01471e Mon Sep 17 00:00:00 2001 From: Philipp Spiess Date: Tue, 28 Jan 2025 16:50:33 +0100 Subject: [PATCH 1/2] Ensure browser package does not pollute global namespace --- packages/@tailwindcss-browser/package.json | 6 +++--- packages/@tailwindcss-browser/tsup.config.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/@tailwindcss-browser/package.json b/packages/@tailwindcss-browser/package.json index 420c2faf7..aef639cf3 100644 --- a/packages/@tailwindcss-browser/package.json +++ b/packages/@tailwindcss-browser/package.json @@ -3,8 +3,8 @@ "version": "4.0.0", "description": "A utility-first CSS framework for rapidly building custom user interfaces.", "license": "MIT", - "main": "./dist/index.mjs", - "browser": "./dist/index.mjs", + "main": "./dist/index.global.js", + "browser": "./dist/index.global.js", "repository": { "type": "git", "url": "https://github.com/tailwindlabs/tailwindcss.git", @@ -19,7 +19,7 @@ "test:ui": "playwright test" }, "exports": { - ".": "./dist/index.mjs", + ".": "./dist/index.global.js", "./package.json": "./package.json" }, "files": [ diff --git a/packages/@tailwindcss-browser/tsup.config.ts b/packages/@tailwindcss-browser/tsup.config.ts index 57fa6d7dc..5a6d78273 100644 --- a/packages/@tailwindcss-browser/tsup.config.ts +++ b/packages/@tailwindcss-browser/tsup.config.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'tsup' export default defineConfig({ - format: ['esm'], + format: ['iife'], clean: true, minify: true, entry: ['src/index.ts'], From 658fd0cd8254222b8c9185ae1f3b87a558f0e2ac Mon Sep 17 00:00:00 2001 From: Philipp Spiess Date: Tue, 28 Jan 2025 16:54:58 +0100 Subject: [PATCH 2/2] Add change log --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2170c400..b28cddbe1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Suggest container query variants ([#15857](https://github.com/tailwindlabs/tailwindcss/pull/15857)) - Disable bare value suggestions when not using the `--spacing` variable ([#15857](https://github.com/tailwindlabs/tailwindcss/pull/15857)) - Ensure suggested classes are properly sorted ([#15857](https://github.com/tailwindlabs/tailwindcss/pull/15857)) +- Ensure that `@tailwindcss/browser` does not pollute the global namespace ([#15978](https://github.com/tailwindlabs/tailwindcss/pull/15978)) - _Upgrade_: Ensure JavaScript config files on different drives are correctly migrated ([#15927](https://github.com/tailwindlabs/tailwindcss/pull/15927)) ## [4.0.0] - 2025-01-21