Skip to content

Commit

Permalink
Fix detection of v4 projects on Windows (#265)
Browse files Browse the repository at this point in the history
* Use file url for dynamic imports

* Update changelog
  • Loading branch information
thecrypticace committed Apr 15, 2024
1 parent 360cb77 commit 3df9921
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/config.js
Expand Up @@ -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'
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 3df9921

Please sign in to comment.