babel-preset-es2015-rollup icon indicating copy to clipboard operation
babel-preset-es2015-rollup copied to clipboard

Loose Mode

Open kennetpostigo opened this issue 7 years ago • 2 comments

Would it be possible to configure es2015 preset with loose mode? It will produce cleaner and less verbose code.

kennetpostigo avatar Dec 03 '16 17:12 kennetpostigo

I'm not exactly sure how to do that – is the preset not configurable directly? It's just removing the module transformer and adding external-helpers, so in theory it should be configurable the same way as the regular es2015 preset (whatever that is – I haven't used Babel in months and everything seems to have changed).

I've just released version 3 of this plugin, which may or may not allow you to configure the underlying plugin...

Sorry I'm not being more help, I've just completely given up trying to keep track of this stuff!

Rich-Harris avatar Dec 12 '16 20:12 Rich-Harris

v3.0 doesn't seem to make any difference.

"presets": [["es2015-rollup", { "loose": true }]],

Warns:

Error transforming file.js with 'babel' plugin: Options {"loose":true} passed to babel-preset-es2015-rollup/index.js which does not accept options. (While processing preset: "babel-preset-es2015-rollup/index.js")

viveleroi avatar Dec 14 '16 23:12 viveleroi