From fee058293e30f32069523d68099f0600ebb551a9 Mon Sep 17 00:00:00 2001 From: Alexander Akait <4567934+alexander-akait@users.noreply.github.com> Date: Thu, 21 Oct 2021 16:27:01 +0300 Subject: [PATCH] refactor: use new API (#1387) --- src/utils.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/utils.js b/src/utils.js index 887d3b24..433a0526 100644 --- a/src/utils.js +++ b/src/utils.js @@ -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;