Skip to content

Commit

Permalink
fix: regexp for some comments (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi committed Sep 28, 2019
1 parent 8c68450 commit 4c4b1f1
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 84 deletions.
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"schema-utils": "^2.4.1",
"serialize-javascript": "^2.1.0",
"source-map": "^0.6.1",
"terser": "^4.3.3",
"terser": "^4.3.4",
"webpack-sources": "^1.4.3"
},
"devDependencies": {
Expand All @@ -62,7 +62,7 @@
"eslint": "^6.3.0",
"eslint-config-prettier": "^6.3.0",
"eslint-plugin-import": "^2.18.2",
"husky": "^3.0.5",
"husky": "^3.0.7",
"jest": "^24.9.0",
"jest-junit": "^8.0.0",
"lint-staged": "^9.4.0",
Expand Down
3 changes: 1 addition & 2 deletions src/minify.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ const buildComments = (options, terserOptions, extractedComments) => {
} else {
// No extract
// Preserve using "commentsOpts" or "some"
// Todo remove this in next major release
condition.preserve =
typeof commentsOpts !== 'undefined' ? commentsOpts : 'some';
condition.extract = false;
Expand Down Expand Up @@ -106,7 +105,7 @@ const buildComments = (options, terserOptions, extractedComments) => {
condition[key] = (astNode, comment) => {
return (
comment.type === 'comment2' &&
/^\**!|@preserve|@license|@cc_on/i.test(comment.value)
/@preserve|@lic|@cc_on|^\**!/i.test(comment.value)
);
};

Expand Down
Loading

0 comments on commit 4c4b1f1

Please sign in to comment.