Code
const { transform } = require('@babel/core');
console.log(
transform(
`let isWeb = true;
{
if (isWeb) {
console.log('xyz');
} else {
console.log('abcd');
}
}
`,
{
plugins: ['babel-plugin-minify-dead-code-elimination'],
}
)
);
If code with a block expression, it will not remove the console.log('abcd');
Output
let isWeb = true;
{
if (isWeb) {
console.log('xyz');
} else {
console.log('abcd');
}
}
Expected
let isWeb = true;
{
console.log('xyz');
}
Code
If code with a block expression, it will not remove the
console.log('abcd');Output
Expected