unjs / pathe

🛣️ Drop-in replacement of the Node.js's path module module that ensures paths are normalized

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

windows and linux `/`, `\` problem

productdevbook opened this issue · comments

import { dirname, join, resolve } from 'pathe'

console.log('a', join('packages/components/'))
linux -> 'packages/components/'
windows -> 'packages/components/'

some problem resolve

but only used 'path'

linux -> 'packages/components/'
windows -> 'packages\components'

One of the purposes of this package is to normalise Windows paths to use forward slashes, for consistency between operating systems.