DEV: makes babel configuration consistent in all cases (PR #10884)

Creates a BabelHelper builder using a default list of plugins, to ensure the transpiled code is always using the same plugins instead of differents plugins in different cases.

GitHub

This feels like a bit of a hack to me. Rather than checking if the value is an array, could you include it in the array without a string encoding like this:

[
  ['proposal-decorators', { legacy: true }]
]

Then you could call to_json on each member of the array to have it encoded propery?

exports would need an exception but you could add another parameter type for that maybe?

Yes that was my feeling, I couldn’t get everything to work in one clean way, so I would rather have a hack at one place solving all cases. I will try to find something better tomorrow.

@eviltrout the plugin failure is not related