Skip to content

Commit 8c4846b

Browse files
fix: small perf improvement (#860)
1 parent 11708c7 commit 8c4846b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/utils.js

+10
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,17 @@ function isRelativePath(str) {
6868
return RELATIVE_PATH_REGEXP.test(str);
6969
}
7070

71+
// TODO simplify for the next major release
7172
function stringifyRequest(loaderContext, request) {
73+
if (
74+
typeof loaderContext.utils !== "undefined" &&
75+
typeof loaderContext.utils.contextify === "function"
76+
) {
77+
return JSON.stringify(
78+
loaderContext.utils.contextify(loaderContext.context, request)
79+
);
80+
}
81+
7282
const splitted = request.split("!");
7383
const { context } = loaderContext;
7484

0 commit comments

Comments
 (0)