Skip to content

Commit

Permalink
feat(index): allow custom options
Browse files Browse the repository at this point in the history
  • Loading branch information
niieani committed Nov 8, 2016
1 parent 00129da commit a89ebd8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@ import * as path from 'path'
* See: https://github.com/deepsweet/istanbul-instrumenter-loader
*/
// NOTE: Currently breaks with Webpack >=2
export = function istanbul({include = undefined, exclude = undefined}:{include?, exclude?} = {}) {
export = function istanbul({include = undefined, exclude = undefined, options = { 'force-sourcemap': true }}:{include?, exclude?, options?} = {}) {
return function istanbul(this: WebpackConfigWithMetadata): WebpackConfigWithMetadata {
return {
module: {
rules: get(this, 'module.rules', []).concat([{
test: /\.(js|ts)$/,
loader: 'sourcemap-istanbul-instrumenter-loader',
query: {
'force-sourcemap': true
},
query: options,
enforce: 'post',
include: include || this.metadata.src,
exclude: exclude || (this.metadata.root ? [path.join(this.metadata.root, 'node_modules')] : []),
Expand Down

0 comments on commit a89ebd8

Please sign in to comment.