Skip to content

Commit 5d0465b

Browse files
authored
Fix: preserve terser annotations regexp (#875)
* fix: preserve terser annotations regexp * chore: add changeset * test: update snapshots
1 parent 1b61029 commit 5d0465b

File tree

3 files changed

+95
-88
lines changed

3 files changed

+95
-88
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'microbundle': patch
3+
---
4+
5+
Preserve terser annotations in compressed bundle

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ function createConfig(options, entry, format, writeMeta) {
592592
// By default, Terser wraps function arguments in extra parens to trigger eager parsing.
593593
// Whether this is a good idea is way too specific to guess, so we optimize for size by default:
594594
wrap_func_args: false,
595-
comments: /^\s*([@#]__[A-Z]__\s*$|@cc_on)/,
595+
comments: /^\s*([@#]__[A-Z]+__\s*$|@cc_on)/,
596596
preserve_annotations: true,
597597
},
598598
module: modern,

0 commit comments

Comments
 (0)