Skip to content

Commit

Permalink
fix: the path \\ on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
KeJunMao committed Jan 15, 2023
1 parent 7370c63 commit 951bc93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/context.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path'
import type { FSWatcher } from 'fs'
import type { Logger, ViteDevServer } from 'vite'
import { Logger, normalizePath, ViteDevServer } from 'vite'
import { loadConfig } from 'unconfig'
import { slash } from '@antfu/utils'
import type { PagesConfig } from './config/types'
Expand Down Expand Up @@ -119,7 +119,7 @@ export class PageContext {
const { relativePath, absolutePath } = page
const routeBlock = await getRouteBlock(absolutePath, this.options)
const relativePathWithFileName = relativePath.replace(path.extname(relativePath), '')
const pageMetaDatum: PageMetaDatum = { path: relativePathWithFileName, type: 'page' }
const pageMetaDatum: PageMetaDatum = { path: normalizePath(relativePathWithFileName), type: 'page' }

if (routeBlock)
Object.assign(pageMetaDatum, routeBlock)
Expand Down

0 comments on commit 951bc93

Please sign in to comment.