Skip to content

Commit 3df9921

Browse files
Fix detection of v4 projects on Windows (#265)
* Use file url for dynamic imports * Update changelog
1 parent 360cb77 commit 3df9921

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
- Nothing yet!
10+
### Fixed
11+
12+
- Fix detection of v4 projects on Windows ([#265](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/pull/265))
1113

1214
## [0.5.13] - 2024-03-27
1315

src/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import * as fs from 'fs/promises'
33
import { createRequire } from 'module'
44
import * as path from 'path'
5+
import { pathToFileURL } from 'url'
56
import clearModule from 'clear-module'
67
import escalade from 'escalade/sync'
78
import postcss from 'postcss'
@@ -181,8 +182,7 @@ async function loadV4(baseDir, pkgDir, entryPoint) {
181182
let pkgPath = localRequire.resolve('tailwindcss', {
182183
paths: [baseDir],
183184
})
184-
185-
let tw = await import(pkgPath)
185+
let tw = await import(pathToFileURL(pkgPath).toString())
186186

187187
// This is not Tailwind v4
188188
if (!tw.__unstable__loadDesignSystem) {

0 commit comments

Comments
 (0)