From 04b36b1a8b521f43c5d65b8288891f8f1cdc6411 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Mon, 15 Apr 2024 15:16:27 -0400 Subject: [PATCH 1/2] Use file url for dynamic imports --- src/config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.js b/src/config.js index d8c0fc2c..81ae3f2f 100644 --- a/src/config.js +++ b/src/config.js @@ -2,6 +2,7 @@ import * as fs from 'fs/promises' import { createRequire } from 'module' import * as path from 'path' +import { pathToFileURL } from 'url' import clearModule from 'clear-module' import escalade from 'escalade/sync' import postcss from 'postcss' @@ -181,8 +182,7 @@ async function loadV4(baseDir, pkgDir, entryPoint) { let pkgPath = localRequire.resolve('tailwindcss', { paths: [baseDir], }) - - let tw = await import(pkgPath) + let tw = await import(pathToFileURL(pkgPath).toString()) // This is not Tailwind v4 if (!tw.__unstable__loadDesignSystem) { From fa4c786953c3d3c98acc599460ab6a7ddb0f21fd Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Mon, 15 Apr 2024 15:20:47 -0400 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 40a1a5ef..149fd555 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 + +- Fix detection of v4 projects on Windows ([#265](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/pull/265)) ## [0.5.13] - 2024-03-27