Skip to content

Commit

Permalink
--no-compress should preserve comments (#648)
Browse files Browse the repository at this point in the history
This fixes #647.
  • Loading branch information
developit committed Jun 3, 2020
1 parent 65df3c1 commit a8a36ac
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/lib/babel-custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,13 @@ export default () => {
babelOptions.plugins || [],
);

babelOptions.generatorOpts = {
minified: customOptions.compress,
compact: customOptions.compress,
shouldPrintComment: comment => /[@#]__PURE__/.test(comment),
};
if (customOptions.compress) {
babelOptions.generatorOpts = {
minified: true,
compact: true,
shouldPrintComment: comment => /[@#]__PURE__/.test(comment),
};
}

return babelOptions;
},
Expand Down

0 comments on commit a8a36ac

Please sign in to comment.