Skip to content

Commit

Permalink
disable side_effects compress option for helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Nov 7, 2022
1 parent afaaaf0 commit f643f17
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions packages/babel-helpers/scripts/generate-helpers.js
Expand Up @@ -47,8 +47,12 @@ export default Object.freeze({

const source = await minify(fileContents, {
mangle: false,
// The _typeof helper has a custom directive that we must keep
compress: { directives: false },
compress: {
// The _typeof helper has a custom directive that we must keep
directives: false,
// The _checkInRHS helper has `0 in value` which does have side effects
side_effects: false,
},
});

output += `\
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-helpers/src/helpers-generated.ts
Expand Up @@ -43,7 +43,7 @@ export default Object.freeze({
),
checkInRHS: helper(
"7.20.1",
"export default function _checkInRHS(value){return value}",
"export default function _checkInRHS(value){return 0 in value,value}",
),
jsx: helper(
"7.0.0-beta.0",
Expand Down

0 comments on commit f643f17

Please sign in to comment.