question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

using uglifyify by default breaks arrow functions

See original GitHub issue

taking 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:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
yoshuawuytscommented, Apr 14, 2017

Merged, closing!

0reactions
toddselfcommented, Apr 13, 2017
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found