From 94aa350dc4a0796874a2abcc8476c230686701e7 Mon Sep 17 00:00:00 2001 From: Liu Date: Mon, 13 Aug 2018 15:46:46 +0800 Subject: [PATCH] Update examples (#48) --- README.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 55795f2..3663ba9 100644 --- a/README.md +++ b/README.md @@ -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() + ] }); ``` @@ -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; } } });