Skip to content

Commit

Permalink
Merge pull request #72 from wayou/master
Browse files Browse the repository at this point in the history
fix: correct the regexp for parsing loader name to support scoped package name
  • Loading branch information
stephencookdev committed Mar 19, 2019
2 parents 6b19154 + 326d625 commit 730f3c0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ module.exports.getLoaderNames = loaders =>
loaders && loaders.length
? loaders
.map(l => l.loader || l)
.map(l => l.replace(/^.*\/node_modules\/([^\/]+).*$/, (_, m) => m))
.map(l =>
l.replace(
/^.*\/node_modules\/(@[a-z0-9][\w-.]+\/[a-z0-9][\w-.]*|[^\/]+).*$/,
(_, m) => m
)
)
.filter(l => !l.includes("speed-measure-webpack-plugin"))
: ["modules with no loaders"];

Expand Down

0 comments on commit 730f3c0

Please sign in to comment.