Skip to content

Commit fee0582

Browse files
refactor: use new API (#1387)
1 parent 60c3755 commit fee0582

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
@@ -22,7 +22,17 @@ function isRelativePath(str) {
2222
return matchRelativePath.test(str);
2323
}
2424

25+
// TODO simplify for the next major release
2526
function stringifyRequest(loaderContext, request) {
27+
if (
28+
typeof loaderContext.utils !== "undefined" &&
29+
typeof loaderContext.utils.contextify === "function"
30+
) {
31+
return JSON.stringify(
32+
loaderContext.utils.contextify(loaderContext.context, request)
33+
);
34+
}
35+
2636
const splitted = request.split("!");
2737
const { context } = loaderContext;
2838

0 commit comments

Comments
 (0)