Uglify can't parse ES6 syntax, and the feature request to support ES6 syntax in Uglify is >3 years old (https://github.com/mishoo/UglifyJS2/issues/448). For projects that feed ES6 source into Storybook (e.g., as output from tsc targetting ES6), Uglify gets in the way.
A configuration option to disable Uglify in Storybook's webpack config was suggested here: https://github.com/storybooks/storybook/issues/788#issuecomment-294299492, and would be a great help!
We can switch to babili plugin. I think that would solve both issues. If you feel like it, I will accept a PR.
Maybe we should pick a sane default and have people provide a custom webpack plugin if they want a more optimised or dev-friendly build.
@ndelangen I created a PR for this, however, I did not create any configurability for the minifier.
I am running into this issue as well. Right now our workaround is to remove the UglifyJS plugin manually through "full-control" mode, which is a bit of an ugly hack.
Hopefully this can be merged soon?
This will be in 3.2.0, right? Looking forward to that :)
@bigfish this is not a change about the be released with 3.2.0, if you want to remove Uglify, you'll need to do so using webpack full control mode.
+1000 on this. Would very much rather pass a single cli flag to turn things off than adopt full-control mode, especially since this arises out of a common babel usage incompatibility.
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 60 days. Thanks!
I will give this on my high priority list to work on after the 3.3 release.
Related:
https://github.com/storybooks/storybook/issues/1570#issuecomment-345896597
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 60 days. Thanks!
Following up here, I dont recall the details, but updating some of our dependencies fixed the issues I was having that caused me to want to turn it off.
We actually use ES6-aware uglify since #2530
Most helpful comment
I am running into this issue as well. Right now our workaround is to remove the UglifyJS plugin manually through "full-control" mode, which is a bit of an ugly hack.
Hopefully this can be merged soon?