Skip to content

Commit

Permalink
fix(node/utils): update multilineCommentsRE regex
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkldshv committed Nov 1, 2022
1 parent c53ffec commit 0d7de5f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vite/src/node/utils.ts
Expand Up @@ -912,7 +912,8 @@ export function toUpperCaseDriveLetter(pathName: string): string {
return pathName.replace(/^\w:/, (letter) => letter.toUpperCase())
}

export const multilineCommentsRE = /\/\*(.|[\r\n])*?\*\//gm
// Taken from https://stackoverflow.com/a/36328890
export const multilineCommentsRE = /\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//gm
export const singlelineCommentsRE = /\/\/.*/g
export const requestQuerySplitRE = /\?(?!.*[\/|\}])/

Expand Down

0 comments on commit 0d7de5f

Please sign in to comment.