From 47cfca4e32810b905b4b9845322139f58ae0f797 Mon Sep 17 00:00:00 2001 From: anonymousthing Date: Mon, 2 Jul 2018 00:43:56 +1000 Subject: [PATCH] Add global hook for getLocalIdent --- lib/loader.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/loader.js b/lib/loader.js index 3d5033f6..82719ab0 100644 --- a/lib/loader.js +++ b/lib/loader.js @@ -19,6 +19,10 @@ module.exports = function(content, map) { var sourceMap = query.sourceMap || false; var resolve = createResolver(query.alias); + if (global && global.getLocalIdent) { + query.getLocalIdent = global.getLocalIdent; + } + if(sourceMap) { if (map) { if (typeof map === "string") { @@ -108,7 +112,7 @@ module.exports = function(content, map) { return "\" + escape(require(" + loaderUtils.stringifyRequest(this, urlRequest) + ")) + \""; }.bind(this)); } - + var exportJs = compileExports(result, importItemMatcher.bind(this), camelCaseKeys); if (exportJs) { exportJs = "exports.locals = " + exportJs + ";";