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

fix: 修复 file-loader 和 webpack 使用 posix 的路径形式,导致拼接路径在 windows 系统上失效的问题 #14549

Merged
merged 2 commits into from
Sep 15, 2023

Conversation

xuanzebin
Copy link
Member

这个 PR 做了什么? (简要描述所做更改)

  • 修复 file-loader 和 webpack 使用 posix 的路径形式,导致拼接路径在 windows 系统上失效的问题

这个 PR 是什么类型? (至少选择一个)

这个 PR 涉及以下平台:

  • 所有小程序
  • 微信小程序
  • 支付宝小程序
  • 百度小程序
  • 字节跳动小程序
  • QQ 轻应用
  • 京东小程序
  • 快应用平台(QuickApp)
  • Web 平台(H5)
  • 移动端(React-Native)
  • 鸿蒙(harmony)

@xuanzebin xuanzebin requested a review from bigmeow September 14, 2023 09:27
@xuanzebin xuanzebin added this to the 3.6.17 milestone Sep 14, 2023
@bigmeow
Copy link
Member

bigmeow commented Sep 15, 2023

和 这个是一起合并的还是 取其一即可?
#14544

@xuanzebin
Copy link
Member Author

和 这个是一起合并的还是 取其一即可? #14544

合并?我理解应该是两个问题:

  1. fix(14371): 修复window环境下路径错误的问题 #14544 处理是因为需要在 windows 系统使用 path.relative api 时输出 posix 格式的路径,即不使用 path.posix 会导致 path.relative 的路径处理在 windows 系统上出现错误
  2. 我这个处理主要是为了匹配 webpack 和 file-loader 的 posix 格式路径,即 webpack 和 file-loader 本来就是以 posix 格式的路径为标准的,所以无需再使用 path.sep 这样区分环境的分隔符,统一采用 posix 标准的分隔符 / 即可

@bigmeow bigmeow merged commit b18b656 into next Sep 15, 2023
@bigmeow bigmeow deleted the fix/windows_sep branch September 15, 2023 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants