Skip to content

Commit

Permalink
fix: support windows separator
Browse files Browse the repository at this point in the history
  • Loading branch information
baozouai committed Mar 19, 2024
1 parent 7866b6b commit 54290a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/generate-history-method-webpack-plugin.ts
Expand Up @@ -243,7 +243,7 @@ export function Router({ children, basename }${isExistTS ? ': RouterProps' : ''}
getParamsMapAndUrlObj(files: string[]) {
// { formatPath => paramsPath }
const paramsMap: Record<string, string> = {}
const regExp = new RegExp(`\/${this.pageName.replace(/(?=\.)/g, '\\')}\.(tsx|jsx?)$`)
const regExp = new RegExp(`[\/\\\\]${this.pageName.replace(/(?=\.)/g, '\\')}\.(tsx|jsx?)$`)
// { formatPath => urlPath }
const urlObj = files.reduce<Record<string, string>>((pre, path) => {
// eg: path: Users/xxx/project/src/pages/order/ ~ q/index.page.tsx
Expand Down

0 comments on commit 54290a3

Please sign in to comment.