Open jsg2021 opened 6 years ago
This is rather persistent... even this triggers it:
function draw () {
const {canvas, layout} = this;
const padding = 2 * CANVAS_PADDING;
canvas.width = layout.canvas.width + padding;
canvas.height = layout.canvas.height + padding;
}
Update: Webpack fixed the "returntrue" problem. I've updated this comment to hide what is now an off-topic comment.
Can you try running the replacements before the minification?
Can your build process substitute typeof define === "function"
with true
before you minify? This will also allow the minifier to remove unnecessary branches/conditionals.
My build process is webpack. I am using this minifier as a preset in the babel-loader... so, not really. Anyways, this has accidentally hijacked the original issue and I have found to be unrelated. (Which is why I updated my comment from two days ago) I originally thought this was related to the original issue, but I believe is intended behavior (the no-space between return and the quote)
Describe the bug
Incorrect optimization.
To Reproduce
Minimal code to reproduce the bug
Actual Output
If there is no Error thrown,
Expected Output
Configuration
How are you using babel-minify?
babel --plugins minify-simplify test.js
babel-minify version:
0.4.3
babel version :
7.1.0
babel-minify-config: none babelrc: none