As @JMM notes, source mapping variable names do not currently work. Babylon needs to change import variable names to support exported bindings from ES2015 modules.
I created a Babel 6 plugin called babel-plugin-transform-es2015-modules-commonjs-simple that will import modules without changing the symbol names due to breaking the "bindings" behavior of ES6 modules. You decide if this is a compromise. Since this the concept does not even exist in CommonJS, it was easy to do for me.
This is a replacement for babel-plugin-transform-es2015-modules-commonjs :
> npm install babel-plugin-transform-es2015-modules-commonjs-simple --save-dev
.babelrc:
{ plugins: [ "transform-es2015-arrow-functions", "transform-es2015-tempalte-literals",
... more plugins
["transform-es2015-modules-commonjs-simple", { noMangle: true }], "sourceMaps": true ] }
If you use presets, this is a little more complicated, because there is currently no clear way to redefine plugins from presets, there are repo instructions.
You can enable or disable the behavior at any time using the noMangle option. The plugin keeps track of the version and really most of the source code of the babel commonjs built-in conversion.
source share