babel-plugin-istanbul icon indicating copy to clipboard operation
babel-plugin-istanbul copied to clipboard

examples of non-env based configuration

Open jbarrus opened this issue 8 years ago • 2 comments

It would be nice to have some documentation of using babel without environment based configuration. For gulp users, for example, you might be using babel to do multiple things in a single run and env variables wouldn't make sense.

For example, when used with a the webpack babel loader, you can use the query param to configure babel options:

module: {
  preLoaders: [
    {
      test: /\.js$/, loader: 'babel', exclude: /node_modules/,
      query: {
        plugins: [
          ['istanbul', {
            'exclude': [
              '**/*.spec.js'
            ]
          }]
        ]
      }
    }
  ]
}

jbarrus avatar Aug 08 '16 19:08 jbarrus

@jbarrus would love some help adding this documentation to the README 👍

bcoe avatar Feb 09 '17 06:02 bcoe

this would be a great first contribution for anyone who's interested in updating docs.

bcoe avatar Jul 22 '17 20:07 bcoe