diff --git a/index.js b/index.js index 9155314..ac7cb7a 100644 --- a/index.js +++ b/index.js @@ -14,10 +14,11 @@ var dictionary = { }; module.exports = function(content) { + var options = loaderUtils.getOptions(this) || {} this.cacheable && this.cacheable(); - var query = loaderUtils.parseQuery(this.query); + var query = this.resourceQuery ? loaderUtils.parseQuery(this.resourceQuery) : {} var ext = loaderUtils.interpolateName(this, "[ext]", { - context: query.context || this.options.context, + context: query.context || options.context || undefined, content: content, regExp: query.regExp }).toLowerCase(); diff --git a/package.json b/package.json index e5c7e53..c36dffb 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "index.js" ], "dependencies": { - "loader-utils": "~0.2.5" + "loader-utils": "^1.1.0" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1"