Skip to content

Commit

Permalink
fix: can't build package on windows (#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 committed May 23, 2023
1 parent 6665f7e commit d3017dd
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

1 comment on commit d3017dd

@vercel
Copy link

@vercel vercel bot commented on d3017dd May 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.