No description
Find a file
Philipp Spiess 2c1dea4c1a
Fix handling of absolute config files in upgrade tool (#15927)
Closes #15220

This PR fixes an issue where the upgrade tool would not be able to load
some JavaScript config files across different drive letters on Windows.

The issue in detail is that `path.relative(…)` tries to build a relative
path but if the file is inside the same folder, it won't start the
relative path with a `./` so we manually appended it in case that it
isn't there. The issue on Windows specifically is that
`file.relative(…)` can also return a legit absolute path, e.g. when the
file is on a different drive. In this case we obviously don't want to
prefix a path with `./`.

## Test plan

To reproduce this issue, I checked out a Tailwind v3 project _on a
different drive letter than my Windows installation_. In that case, I
was adding a repo inside `D:` while `npm` was installed in `C:`. I then
run `npx @tailwindcss/upgrade` to reproduce the issue.

The fix was validated with a local `bun` run of the upgrade tool:


![telegram-cloud-photo-size-4-5818901845756725194-y](https://github.com/user-attachments/assets/d32b21e3-a08d-4608-b65a-93dddc04f890)
2025-01-28 12:42:30 +01:00
.github Add musl binaries to the Standalone CLI (#15567) 2025-01-09 09:24:33 -05:00
crates Prepare v4.0.0 release (#15693) 2025-01-21 20:58:59 +00:00
integrations Implement @variant (#15663) 2025-01-21 10:20:35 -05:00
packages Fix handling of absolute config files in upgrade tool (#15927) 2025-01-28 12:42:30 +01:00
patches Upgrade lightningcss to 1.29.1 (#15593) 2025-01-10 14:09:13 +01:00
playgrounds Update eslint 9.17.0 → 9.18.0 (minor) (#15664) 2025-01-27 13:30:56 +01:00
scripts Fix integration tests on Windows (#14824) 2024-10-30 11:26:29 +00:00
.gitignore Add test.debug to integration tests (#14133) 2024-08-08 12:02:19 +02:00
.npmrc introduce v4 codebase 2024-03-05 14:29:15 +01:00
.prettierignore Hoist oxide/crates to just crates (#13333) 2024-03-23 09:00:48 -04:00
Cargo.lock Auto source detection improvements (#14820) 2024-10-29 20:33:34 +00:00
Cargo.toml Hoist oxide/crates to just crates (#13333) 2024-03-23 09:00:48 -04:00
CHANGELOG.md Fix handling of absolute config files in upgrade tool (#15927) 2025-01-28 12:42:30 +01:00
LICENSE Add README, LICENSE, and CONTRIBUTING (#13088) 2024-03-05 14:45:39 -05:00
package.json Update postcss 8.4.49 → 8.5.1 (minor) (#15675) 2025-01-20 21:50:29 +01:00
pnpm-lock.yaml Update eslint 9.17.0 → 9.18.0 (minor) (#15664) 2025-01-27 13:30:56 +01:00
pnpm-workspace.yaml Upgrade lightningcss to 1.29.1 (#15593) 2025-01-10 14:09:13 +01:00
README.md Copy README file to every package (#13096) 2024-03-06 08:49:31 -05:00
rust-toolchain.toml Bring back rust-toolchain.toml (#14585) 2024-10-03 14:37:24 +00:00
turbo.json Auto source detection improvements (#14820) 2024-10-29 20:33:34 +00:00
vitest.workspace.ts introduce v4 codebase 2024-03-05 14:29:15 +01:00

Tailwind CSS

A utility-first CSS framework for rapidly building custom user interfaces.

Build Status Total Downloads Latest Release License


Documentation

For full documentation, visit tailwindcss.com.

Community

For help, discussion about best practices, or any other conversation that would benefit from being searchable:

Discuss Tailwind CSS on GitHub

For chatting with others using the framework:

Join the Tailwind CSS Discord Server

Contributing

If you're interested in contributing to Tailwind CSS, please read our contributing docs before submitting a pull request.