Skip to content

Commit

Permalink
build: dont strip single line comments (#14969)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Nov 13, 2023
1 parent 55335cc commit ea9ccb7
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions packages/vite/rollup.dts.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export default defineConfig({

// Taken from https://stackoverflow.com/a/36328890
const multilineCommentsRE = /\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g
const singlelineCommentsRE = /\/\/[^/].*/g
const licenseCommentsRE = /MIT License|MIT license|BSD license/
const consecutiveNewlinesRE = /\n{2,}/g
const identifierWithTrailingDollarRE = /\b(\w+)\$\d+\b/g
Expand Down Expand Up @@ -239,7 +238,6 @@ function removeInternal(s: MagicString, node: any): boolean {

function cleanUnnecessaryComments(code: string) {
return code
.replace(singlelineCommentsRE, '')
.replace(multilineCommentsRE, (m) => {
return licenseCommentsRE.test(m) ? '' : m
})
Expand Down

0 comments on commit ea9ccb7

Please sign in to comment.