systemjs / plugin-babel

SystemJS Babel Plugin
MIT License
83 stars 33 forks source link

Feature request - provide callback for specifying babel's inputSourceMap #72

Open dmurat opened 7 years ago

dmurat commented 7 years ago

I will like to have more options for specifying babel's inputSourceMap option. I believe this can be implemented quite easily by adding support for providing a callback through babelOptions.

Usage example:

    meta: {
      '*.js': {
        babelOptions: {
          sourceMaps: true,
          provideInputSourceMap: function(load) {
            return null;
          }
        }
      }
    }

To implement this support, line 176 in plugin-babel.js needs to be changed from

inputSourceMap: load.metadata.sourceMap,

to

inputSourceMap: (babelOptions.provideInputSourceMap && babelOptions.provideInputSourceMap(load)) || load.metadata.sourceMap,

I can provide PR if needed.

Tnx

dmurat commented 7 years ago

Here is a PR: https://github.com/systemjs/plugin-babel/pull/73 Tnx