Skip to content

Commit

Permalink
Update examples (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
lc-soft authored and TrySound committed Aug 13, 2018
1 parent e298c5b commit 94aa350
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions README.md
Expand Up @@ -20,10 +20,10 @@ import { rollup } from 'rollup';
import { uglify } from 'rollup-plugin-uglify';

rollup({
entry: 'main.js',
plugins: [
uglify()
]
entry: 'main.js',
plugins: [
uglify()
]
});
```

Expand All @@ -46,13 +46,12 @@ If you'd like to preserve comments (for licensing for example), then you can spe
```js
uglify({
output: {
comments: function(node, comment) {
var text = comment.value;
var type = comment.type;
if (type == "comment2") {
// multiline comment
return /@preserve|@license|@cc_on/i.test(text);
}
comments: function (node, comment) {
if (comment.type === "comment2") {
// multiline comment
return /@preserve|@license|@cc_on/i.test(comment.value);
}
return false;
}
}
});
Expand Down

0 comments on commit 94aa350

Please sign in to comment.