Skip to content

Commit

Permalink
fix: can't build package on windows (shuding#1894)
Browse files Browse the repository at this point in the history
* fix: can't build package on windows

* chore: replace winPath with slash
  • Loading branch information
AkaraChen authored and filiphuhta committed May 24, 2023
1 parent cb3d428 commit b194f50
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/nextra/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineConfig } from 'tsup'
import fs from 'node:fs/promises'
import path from 'node:path'
import fg from 'fast-glob'
import slash from 'slash'

import tsconfig from './tsconfig.json'

Expand Down Expand Up @@ -33,14 +34,14 @@ const sharedConfig = defineConfig({
!args.path.endsWith('.json')
) {
let isDir: boolean
const importPath = path.join(args.resolveDir, args.path)
const importPath = slash(path.join(args.resolveDir, args.path))
try {
isDir = (await fs.stat(importPath)).isDirectory()
} catch {
isDir = false
}

const isClientImporter = entriesSet.has(args.importer)
const isClientImporter = entriesSet.has(slash(args.importer))

if (isClientImporter) {
const isClientImport = entries.some(entry =>
Expand Down

0 comments on commit b194f50

Please sign in to comment.