using uglifyify by default breaks arrow functions
See original GitHub issuetaking choo’s minimal example and changing the view to read
function mainView (state, emit) {
var onclick = () => emit('increment', 1)
return html`
<body>
<h1>count is ${state.count}</h1>
<button onclick=${onclick}>Increment</button>
</body>
`
}
and running bankai build index ./target
produces an unexpected token: punc ())
error with bankai 7.0.0, but works fine with bankai 6.1.1.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Uglifyify breaks the build when using arrow functions · Issue #103 ...
I tried making the main function into an arrow function and things broke, the page just said punc ()) Unexpected token. Removing -g...
Read more >Gulp uglify unable to handle arrow functions - Stack Overflow
Arrow functions are an ES6 feature. Babel (and others) are designed to translate ES6 to ES5 or earlier as part of your build...
Read more >Arrow function expressions - JavaScript - MDN Web Docs
An arrow function expression is a compact alternative to a traditional function expression, with some semantic differences and deliberate ...
Read more >uglify-es - npm
uglify -es. A JavaScript parser, mangler/compressor and beautifier toolkit for ES6+. Note: uglify-es is API/CLI compatible with uglify-js@3 ...
Read more >Breaking Down ES6: Arrow Functions - DEV Community
One of the biggest up sides of using arrow functions is that it creates less code, as the syntax is shorter than a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Merged, closing!
Here is a PR to fix this: https://github.com/yoshuawuyts/bankai/pull/158