Skip to content

Commit

Permalink
fix: fix sync tailwind failed on windows(epicmaxco#4174)
Browse files Browse the repository at this point in the history
  • Loading branch information
gweesin committed Apr 7, 2024
1 parent f675d44 commit 538d920
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/tailwind/helpers/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import fs from 'fs'
import { resolve } from 'pathe'
import { pathToFileURL } from 'url';

export const defaultTailwindConfigFilename = 'tailwind.config.cjs'
export const tailwindConfigFilename = fs.readdirSync('.').find((fileName: string) => fileName.startsWith('tailwind.config.'))
export const tailwindConfigPath = tailwindConfigFilename ? resolve(process.cwd(), tailwindConfigFilename) : undefined
export const tailwindConfigPath = tailwindConfigFilename ? pathToFileURL(resolve(process.cwd(), tailwindConfigFilename)) : undefined

/**
* @param value any value for converting it to raw string
Expand Down
2 changes: 1 addition & 1 deletion packages/tailwind/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineConfig } from 'vite'
import { resolve } from 'path'

const pkg = require('./package.json')
const external = [...Object.keys(pkg.peerDependencies), 'fs', 'path']
const external = [...Object.keys(pkg.peerDependencies), 'fs', 'path', 'url']

export default defineConfig({
build: {
Expand Down

0 comments on commit 538d920

Please sign in to comment.