Skip to content

Commit a8a36ac

Browse files
authored
--no-compress should preserve comments (#648)
This fixes #647.
1 parent 65df3c1 commit a8a36ac

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/lib/babel-custom.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,13 @@ export default () => {
180180
babelOptions.plugins || [],
181181
);
182182

183-
babelOptions.generatorOpts = {
184-
minified: customOptions.compress,
185-
compact: customOptions.compress,
186-
shouldPrintComment: comment => /[@#]__PURE__/.test(comment),
187-
};
183+
if (customOptions.compress) {
184+
babelOptions.generatorOpts = {
185+
minified: true,
186+
compact: true,
187+
shouldPrintComment: comment => /[@#]__PURE__/.test(comment),
188+
};
189+
}
188190

189191
return babelOptions;
190192
},

0 commit comments

Comments
 (0)