Skip to content

Commit

Permalink
feat(all): use sourcemap-istanbul-instrumenter-loader
Browse files Browse the repository at this point in the history
  • Loading branch information
niieani committed Jun 23, 2016
1 parent ce7a075 commit c8b0055
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"typings": "^1.3.0"
},
"dependencies": {
"istanbul-instrumenter-loader": "^0.2.0"
"sourcemap-istanbul-instrumenter-loader": "^0.2.0"
},
"peerDependencies": {
"@easy-webpack/core": "*"
Expand Down
11 changes: 7 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ import * as path from 'path'
* See: https://github.com/deepsweet/istanbul-instrumenter-loader
*/
// NOTE: Currently breaks with Webpack >=2
export = function istanbul(exclude: Array<string> = null) {
export = function istanbul(include?, exclude?: Array<string>) {
return function istanbul(this: WebpackConfig): WebpackConfig {
return {
module: {
postLoaders: get(this, 'module.postLoaders', []).concat([{
test: /\.(js|ts)$/,
loader: 'istanbul-instrumenter',
include: this.metadata.src,
exclude: exclude || this.metadata.root ? [path.join(this.metadata.root, 'node_modules'), /\.(e2e|spec)\.(js|ts)x?$/] : [],
loader: 'sourcemap-istanbul-instrumenter',
query: {
'force-sourcemap': true
},
include: include || this.metadata.src,
exclude: exclude || this.metadata.root ? [path.join(this.metadata.root, 'node_modules')] : [],
}])
}
}
Expand Down

0 comments on commit c8b0055

Please sign in to comment.