Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup produces invalid code (from some valid code produced by babel-minify) #2191

Closed
tex0l opened this issue May 15, 2018 · 5 comments · Fixed by #2194
Closed

Rollup produces invalid code (from some valid code produced by babel-minify) #2191

tex0l opened this issue May 15, 2018 · 5 comments · Fixed by #2194

Comments

@tex0l
Copy link

tex0l commented May 15, 2018

Hi!
When I try to rollup this:

global.foo=()=>{return!1,null};

I get this:

'use strict';

global.foo=()=>{returnnull};

Which is invalid, and I would have expected something like this:

'use strict';

global.foo=()=>{return null};

Here is the test case to reproduce:
https://github.com/tex0l/bug-report-rollup

The input snippet of the test case was produced by using babel-minify@0.4.3 on this — though I'm not sure why it produces that — (check the commit history, I initially thought it was a problem with rollup-plugin-babel):

global.foo = () => {
  const bar = {}
  if (false) {}
  return null
}
@lukastaegert
Copy link
Member

If you install rollup via npm i rollup/rollup#missing-space, it should be working. Hope we can release this soon.

@arantes555
Copy link

I can confirm I ran into the same issue, more precisely while using rollup & babel-minify on vuejs.

(My build worked in dev, and not in prod, which was kind of mind-blowing. It was actually because, as is advised by vuejs, I replaced process.env.NODE_ENV by 'production' in prod, which triggered DCE, which triggered the bug)

@lukastaegert : I can also confirm that my build works with rollup/rollup#missing-space! Looking forward to seeing this released :)

@lukastaegert
Copy link
Member

It is released already ☺️

@arantes555
Copy link

Damn, you released it literally one minute before I posted my comment, that was fast 😜 incredible job guys ! Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants