Skip to content

Commit 326d625

Browse files
committed
fix: correct the regexp for parsing loader name to support scoped package name
1 parent cffa93f commit 326d625

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

utils.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ module.exports.getLoaderNames = loaders =>
5050
loaders && loaders.length
5151
? loaders
5252
.map(l => l.loader || l)
53-
.map(l => l.replace(/^.*\/node_modules\/([^\/]+).*$/, (_, m) => m))
53+
.map(l =>
54+
l.replace(
55+
/^.*\/node_modules\/(@[a-z0-9][\w-.]+\/[a-z0-9][\w-.]*|[^\/]+).*$/,
56+
(_, m) => m
57+
)
58+
)
5459
.filter(l => !l.includes("speed-measure-webpack-plugin"))
5560
: ["modules with no loaders"];
5661

0 commit comments

Comments
 (0)