Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Cross-platform path parsing error, can not recognize backslash('\') on windows when using scanOptions. #41

Closed
Xli33 opened this issue May 3, 2023 · 3 comments · Fixed by #42
Assignees
Labels
bug Something isn't working

Comments

@Xli33
Copy link

Xli33 commented May 3, 2023

配置

scanOptions: {
          scanDirs: 'src/pages',
          entryFile: 'main.ts',
          filename: (name) => `pages/${name}.html`
        }

然后无论开发还是打包都会报错
Entry must be an absolute path relative to the project root, received '\src\pages\xxx\main.ts'

image

应该是因为configInit里面只判断了 / ,但windows上用的 \ 所以 path.join 返回路径里的分隔符是 \ ,从而导致匹配不到报错

image

@emosheeep
Copy link
Owner

确实没考虑到windows系统,我没有windows电脑,我还得想想怎么调试🤔

@emosheeep emosheeep self-assigned this May 4, 2023
@emosheeep emosheeep added the bug Something isn't working label May 4, 2023
@emosheeep emosheeep linked a pull request May 4, 2023 that will close this issue
@emosheeep emosheeep changed the title Bug:Windows 上使用 scanOptions 会报错,Entry must be an absolute path relative to the project root, received '${page.entry}' BUG: Cross-platform path parsing error, can not recognize backslash('\') on windows when using scanOptions. May 4, 2023
@emosheeep emosheeep pinned this issue May 4, 2023
@emosheeep
Copy link
Owner

刚刚发了 1.8.3-beta.0 版本,你可以试试看有没有问题,没问题的话我就发正式版了

@Xli33
Copy link
Author

Xli33 commented May 12, 2023

刚刚发了 1.8.3-beta.0 版本,你可以试试看有没有问题,没问题的话我就发正式版了

好的,刚试了ok,多谢大佬,辛苦大佬♪(・ω・)ノ

@emosheeep emosheeep unpinned this issue Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants