fix: escape question mark in file extension regex to prevent incorrect replacements#13166
Open
keuby wants to merge 1 commit into
Open
fix: escape question mark in file extension regex to prevent incorrect replacements#13166keuby wants to merge 1 commit into
keuby wants to merge 1 commit into
Conversation
|
Someone is attempting to deploy a commit to the chencheng's projects Team on Vercel. A member of the Team first needs to authorize it. |
b153721 to
48304f5
Compare
…ent incorrect replacements
48304f5 to
cd86d47
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
对于 vite bundler 构建时,会使用
?url的方式导入文件 url,例如如下场景umi/packages/preset-umi/src/libs/folderCache/LazySourceCodeCache.ts
Lines 188 to 194 in 5b6b16d
此时 189 行
newFile的值会为path/to/font_5036736_flr7joicve?url,由于?在正则表达式中存在特殊含义,191 行中通过extname方法返回值构建的正则表达式为/.js?url/并不能正确替换为.js,正确的正则表达式应该为/\.js\?url/