From e4ff8a4bae7a549eb67e4b892af0c9ddd55dd852 Mon Sep 17 00:00:00 2001 From: Vignesh Shanmugam Date: Thu, 17 May 2018 15:21:46 +0200 Subject: [PATCH] update readme and test --- packages/babel-minify/README.md | 1 + packages/babel-minify/src/index.js | 2 +- .../__tests__/fixtures/merge-if-2/actual.js | 3 +-- .../__tests__/fixtures/merge-if-2/expected.js | 1 - packages/gulp-babel-minify/README.md | 1 + packages/gulp-babel-minify/src/index.js | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/babel-minify/README.md b/packages/babel-minify/README.md index abc9c5e3c..cc7b1d449 100644 --- a/packages/babel-minify/README.md +++ b/packages/babel-minify/README.md @@ -50,6 +50,7 @@ Refer [babel-preset-minify options](https://github.com/babel/minify/tree/master/ + `minifyPreset`: Custom minify preset + `inputSourceMap`: Input Sourcemap + `sourceMaps`: [Boolean] ++ `comments`: [Function | RegExp | Boolean] ## CLI Options diff --git a/packages/babel-minify/src/index.js b/packages/babel-minify/src/index.js index 2e96c4c96..e8d598148 100644 --- a/packages/babel-minify/src/index.js +++ b/packages/babel-minify/src/index.js @@ -12,7 +12,7 @@ module.exports = function babelMinify( inputSourceMap, sourceMaps = false, sourceType = "script", - comments = /^\**!|@preserve|@licen(c|s)e|@cc_on/, + comments = /^\**!|@preserve|@licen[sc]e|@cc_on/, // to override the default babelCore used babel = babelCore, diff --git a/packages/babel-plugin-minify-simplify/__tests__/fixtures/merge-if-2/actual.js b/packages/babel-plugin-minify-simplify/__tests__/fixtures/merge-if-2/actual.js index 0cefa94bb..a79b00376 100644 --- a/packages/babel-plugin-minify-simplify/__tests__/fixtures/merge-if-2/actual.js +++ b/packages/babel-plugin-minify-simplify/__tests__/fixtures/merge-if-2/actual.js @@ -1,6 +1,5 @@ -// FIXME: for some reason, the inner `if` statement gets indented 4 spaces. function foo() { if (a) { - if (b()) return false; + if (b()) return false; } else if (c()) return true; } diff --git a/packages/babel-plugin-minify-simplify/__tests__/fixtures/merge-if-2/expected.js b/packages/babel-plugin-minify-simplify/__tests__/fixtures/merge-if-2/expected.js index 87f529507..532d9d21c 100644 --- a/packages/babel-plugin-minify-simplify/__tests__/fixtures/merge-if-2/expected.js +++ b/packages/babel-plugin-minify-simplify/__tests__/fixtures/merge-if-2/expected.js @@ -1,4 +1,3 @@ -// FIXME: for some reason, the inner `if` statement gets indented 4 spaces. function foo() { if (a) { if (b()) return false; diff --git a/packages/gulp-babel-minify/README.md b/packages/gulp-babel-minify/README.md index 0954e5c42..aa26cea40 100644 --- a/packages/gulp-babel-minify/README.md +++ b/packages/gulp-babel-minify/README.md @@ -39,3 +39,4 @@ Default: `{}` + `babel`: Use a custom `@babel/core` + `minifyPreset`: Use a custom `babel-preset-minify` ++ `comments`: [Function | RegExp | Boolean] diff --git a/packages/gulp-babel-minify/src/index.js b/packages/gulp-babel-minify/src/index.js index 713e67988..5ea7df0fd 100644 --- a/packages/gulp-babel-minify/src/index.js +++ b/packages/gulp-babel-minify/src/index.js @@ -13,7 +13,7 @@ function gulpBabelMinify( { babel = babelCore, minifyPreset = babelPresetMinify, - comments = /^\**!|@preserve|@licen(c|s)e|@cc_on/, + comments = /^\**!|@preserve|@licen[sc]e|@cc_on/, sourceType = "script" } = {} ) {