Skip to content

Commit

Permalink
fix: cannot recognize JS url correctly(vitejs#3568) (vitejs#3572)
Browse files Browse the repository at this point in the history
Co-authored-by: mayingying1 <mayingying1@corp.netease.com>
  • Loading branch information
2 people authored and ygj6 committed Jun 1, 2021
1 parent 974e03a commit dc78073
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite/src/node/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ export const isDataUrl = (url: string): boolean => dataUrlRE.test(url)

const knownJsSrcRE = /\.((j|t)sx?|mjs|vue|marko|svelte)($|\?)/
export const isJSRequest = (url: string): boolean => {
url = cleanUrl(url)
if (knownJsSrcRE.test(url)) {
return true
}
url = cleanUrl(url)
if (!path.extname(url) && !url.endsWith('/')) {
return true
}
Expand Down

0 comments on commit dc78073

Please sign in to comment.