Skip to content
Alberto Martínez edited this page Sep 6, 2016 · 10 revisions

rollup-plugin-jscc wiki

(Documentation is in TODO)

Options

A plain JavaScript object, all the properties are optionals...

Option Default Description
sourceMaps true pass false to ommit sourceMaps if you dont need these.
comments "some" Comments matching the filter are preserved.
values {} The properties are jscc variables, where each key is a name.

The comments option

This option can be a boolean, string, regex, or an array of string and/or regexes:

Value Do...
true or "all" Preserve all comments.
false or "none" Remove all comments.
Regex Use this for filtering the comments to remove (non matching ones).
String The name of one of the predefined filters.
Array of regexes or predefined filters names.

Predefined Filters

Name Regex Site/Description
license /^@license\b/ Preserve comments with "@license" inside.
some `/(?:@license @preserve
jsdoc /^\/\*\*[^@]*@[A-Za-z]/ JSDoc
jslint `/^/[*/](?:jslint global
jshint `/^/[/]\s(?:jshint globals
eslint `/^/[/]\s(?:eslint(?:\s -[ed])
jscs /^\/[*\/]\s*jscs:[ed]/ jscs
istanbul /^\/[*\/]\s*istanbul\s/ istanbul
srcmaps /\/\/#\ssource(Mapping)URL=/ Source Maps in HTML 5 Rocks!
html /<!--(?!>)[\S\s]*?-->/g HTML comments (multiline)
Clone this wiki locally