Appearance
boolean
Control which comments are preserved in the output.
true
false
legal
@license
@preserve
//!
/*!
annotation
@__PURE__
@__NO_SIDE_EFFECTS__
@vite-ignore
jsdoc
Note: Regular line and block comments without these markers are always removed regardless of this option.
When both legalComments and comments.legal are set, comments.legal takes priority.
legalComments
comments.legal
comments
boolean| object with the properties belowControl which comments are preserved in the output.
true: Preserve legal, annotation, and JSDoc comments (default)false: Strip all commentslegal:@license,@preserve,//!,/*!annotation:@__PURE__,@__NO_SIDE_EFFECTS__,@vite-ignorejsdoc: JSDoc commentsNote: Regular line and block comments without these markers are always removed regardless of this option.
When both
legalCommentsandcomments.legalare set,comments.legaltakes priority.Default
annotation?
booleanjsdoc?
booleanlegal?
boolean