Minify: NFE name is not removed w. es2015 preset

Created on 22 Nov 2016  路  4Comments  路  Source: babel/minify

> babel.transform('var x = { y: function y() {} }', { presets: ['babili'] }).code
'var x={y:function(){}};'
> babel.transform('var x = { y: function y() {} }', { presets: ['babili', 'es2015'] }).code
'"use strict";var x={y:function y(){}};'

Why did we leave y in the 2nd case?

bug

Most helpful comment

@kangax I will take it :)

All 4 comments

@kangax I will take it :)

The problem here is..

babel-plugin-transform-es2015-function-name plugin in the es2015 preset adds the function name again to the output.

Ahh.. ok so this works for me. This is a non-issue then.

> require('babel-core').transform('var x = { y: function y() {} }', { presets: ['es2015', 'babili'], passPerPreset: true }).code;

@kangax i sent a PR anyway to fix this issue.

Was this page helpful?
0 / 5 - 0 ratings