Skip to content

Commit

Permalink
fix(compileSiteEntry): slash path for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
BeADre committed May 5, 2022
1 parent 0327bb6 commit 5170997
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/varlet-cli/src/compiler/compileSiteEntry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
SRC_DIR,
} from '../shared/constant'
import { copy } from 'fs-extra'
import slash from 'slash'
import { glob, isDir, outputFileSyncOnChange } from '../shared/fsUtils'
import { getVarletConfig } from '../config/varlet.config'
import { get } from 'lodash'
Expand Down Expand Up @@ -84,7 +85,7 @@ export async function findRootLocales(): Promise<string[]> {
const filterMap = new Map()
baseLocales.forEach((locale) => {
const [, routePath, language] = locale.match(ROOT_LOCALE_RE) ?? []
filterMap.set(routePath + language, `${SITE_PC_DIR}/pages/${routePath}/locale/${language}.ts`)
filterMap.set(routePath + language, slash(`${SITE_PC_DIR}/pages/${routePath}/locale/${language}.ts`))
})

userLocales.forEach((locale) => {
Expand Down Expand Up @@ -152,7 +153,7 @@ export async function buildPcSiteRoutes() {
const layoutRoutes = `{
path: '/layout',
// @ts-ignore
component:()=> import('${SITE_PC_DIR}/Layout.vue'),
component:()=> import('${slash(SITE_PC_DIR)}/Layout.vue'),
children: [
${[...componentDocsRoutes, rootDocsRoutes].join(',')},
]
Expand Down

0 comments on commit 5170997

Please sign in to comment.