Appearance
boolean
Control which comments are preserved in the output.
true
false
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 that contain @__PURE__, @__NO_SIDE_EFFECTS__ or @vite-ignore
@__PURE__
@__NO_SIDE_EFFECTS__
@vite-ignore
JSDoc comments
Comments that contain @license, @preserve or start with //! or /*!
@license
@preserve
//!
/*!
Get our FREE eBook "10 Programming Tips That Changed Everything" when you subscribe!
No spam. Unsubscribe anytime.
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 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? β
booleanComments that contain
@__PURE__,@__NO_SIDE_EFFECTS__or@vite-ignorejsdoc? β
booleanJSDoc comments
legal? β
booleanComments that contain
@license,@preserveor start with//!or/*!