Skip to content

Commit

Permalink
refactor: use new API (#1387)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait authored Oct 21, 2021
1 parent 60c3755 commit fee0582
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,17 @@ function isRelativePath(str) {
return matchRelativePath.test(str);
}

// TODO simplify for the next major release
function stringifyRequest(loaderContext, request) {
if (
typeof loaderContext.utils !== "undefined" &&
typeof loaderContext.utils.contextify === "function"
) {
return JSON.stringify(
loaderContext.utils.contextify(loaderContext.context, request)
);
}

const splitted = request.split("!");
const { context } = loaderContext;

Expand Down

0 comments on commit fee0582

Please sign in to comment.