File tree 2 files changed +5
-1
lines changed
packages/tailwindcss-language-server/src
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { CacheMap } from './cache-map'
15
15
import { getPackageRoot } from './util/get-package-root'
16
16
import resolveFrom from './util/resolveFrom'
17
17
import { Feature , supportedFeatures } from './features'
18
+ import { pathToFileURL } from 'node:url'
18
19
19
20
export interface ProjectConfig {
20
21
/** The folder that contains the project */
@@ -406,6 +407,7 @@ async function* contentSelectorsFromCssConfig(entry: ConfigEntry): AsyncIterable
406
407
async function * detectContentFiles ( base : string ) : AsyncIterable < string > {
407
408
try {
408
409
let oxidePath = resolveFrom ( path . dirname ( base ) , '@tailwindcss/oxide' )
410
+ oxidePath = pathToFileURL ( oxidePath ) . href
409
411
410
412
// This isn't a v4 project
411
413
const oxide = await import ( oxidePath )
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ import { loadDesignSystem } from './util/v4'
79
79
import { readCssFile } from './util/css'
80
80
import type { AstNode } from 'tailwindcss-language-service/src/util/v4'
81
81
import * as postcss8 from 'postcss'
82
+ import { pathToFileURL } from 'url'
82
83
83
84
const colorNames = Object . keys ( namedColors )
84
85
@@ -419,14 +420,15 @@ export async function createProjectService(
419
420
let applyComplexClasses : any
420
421
421
422
try {
422
- const tailwindcssPath = resolveFrom ( configDir , 'tailwindcss' )
423
+ let tailwindcssPath = resolveFrom ( configDir , 'tailwindcss' )
423
424
const tailwindcssPkgPath = resolveFrom ( configDir , 'tailwindcss/package.json' )
424
425
const tailwindDir = path . dirname ( tailwindcssPkgPath )
425
426
tailwindcssVersion = require ( tailwindcssPkgPath ) . version
426
427
427
428
let features = supportedFeatures ( tailwindcssVersion )
428
429
log ( `supported features: ${ JSON . stringify ( features ) } ` )
429
430
431
+ tailwindcssPath = pathToFileURL ( tailwindcssPath ) . href
430
432
tailwindcss = await import ( tailwindcssPath )
431
433
tailwindcss = tailwindcss . default ?? tailwindcss
432
434
log ( `Loaded tailwindcss v${ tailwindcssVersion } : ${ tailwindDir } ` )
You can’t perform that action at this time.
0 commit comments