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

Some of the plugin in this preset delete array reverse call #628

Closed
yuri-karadzhov opened this issue Jul 11, 2017 · 3 comments
Closed

Some of the plugin in this preset delete array reverse call #628

yuri-karadzhov opened this issue Jul 11, 2017 · 3 comments

Comments

@yuri-karadzhov
Copy link

yuri-karadzhov commented Jul 11, 2017

Babili deletes array reverse call (and probably something else as well)

npm install babel-preset-babili
echo '[...a].reverse()' | babel --presets=babili

And the result is

[...a]

reverse() disappears for no reasons

@yuri-karadzhov yuri-karadzhov changed the title Some of the plugin in this preset ruin spred reverse Some of the plugin in this preset delete array reverse call Jul 11, 2017
@j-f1
Copy link
Contributor

j-f1 commented Jul 11, 2017

Looks like I need to exclude array literals with spreads from most of the array methods.

@yuri-karadzhov
Copy link
Author

yuri-karadzhov commented Jul 11, 2017

Seems like it is plugin babel-plugin-minify-constant-folding that causes the problem

echo 'export const b = a => [...a].reverse()' | babel --plugins=babel-plugin-minify-constant-folding
# export const b = a => [...a];

@yuri-karadzhov
Copy link
Author

babel-plugin-minify-constant-folding@0.1.1 does not have this problem

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

No branches or pull requests

2 participants