Skip to content

Commit

Permalink
Use file url for dynamic imports
Browse files Browse the repository at this point in the history
  • Loading branch information
thecrypticace committed Apr 15, 2024
1 parent 360cb77 commit 04b36b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/config.js
Original file line number Diff line number Diff line change
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 04b36b1

Please sign in to comment.