-
Notifications
You must be signed in to change notification settings - Fork 304
build: update vite version and fix inline-chunk plugin #2722
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ export default function ({ deleteInlinedFiles = true }): Plugin { | |
if (!jsChunk.code) continue | ||
|
||
if (format === 'es') { | ||
const reg = /^import(\s*.+\s*from)?\s+"[./]+(.+-[a-f0-9]{8}.+)".*$/gim | ||
const reg = /^import(\s*.+\s*from)?\s+"[./]+(.+-[A-Za-z0-9_-]{8}\.[mc]?js)".*$/gim | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The regular expression has been updated to match a broader range of file name patterns, including different extensions and character sets. Ensure that this change does not inadvertently match unintended file names. |
||
const matchArr = jsChunk.code.match(reg) | ||
if (matchArr) { | ||
const filePath = path.join(dir, jsName) | ||
|
@@ -40,7 +40,7 @@ export default function ({ deleteInlinedFiles = true }): Plugin { | |
} | ||
|
||
if (format === 'cjs') { | ||
const reg = /require\("[./]+(.+-[a-f0-9]{8}.+)".*$/gim | ||
const reg = /require\("[./]+(.+-[A-Za-z0-9_-]{8}\.[mc]?js)".*$/gim | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The regular expression for 'require' statements has been updated similarly to the 'import' statements. Verify that this change aligns with the intended file patterns and does not introduce any security vulnerabilities. |
||
const matchArr = jsChunk.code.match(reg) | ||
if (matchArr) { | ||
const filePath = path.join(dir, jsName) | ||
|
Uh oh!
There was an error while loading. Please reload this page.