From d677feb317d3d28184d81565d8630a2c87b4b2fc Mon Sep 17 00:00:00 2001 From: Konstantin Burkalev Date: Thu, 16 Mar 2017 12:55:29 +0300 Subject: [PATCH] Updated loader configuration read for webpack 2 --- index.js | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 58639ef..2d87176 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ var _ = require('lodash'); -var utils = require('loader-utils'); +var loaderUtils = require('loader-utils'); function processQuery(source, query) { if (!_.isUndefined(query.search) && !_.isUndefined(query.replace)) { @@ -14,9 +14,9 @@ function processQuery(source, query) { } module.exports = function (source) { - this.cacheable(); + if(this.cacheable) this.cacheable(); - var query = utils.parseQuery(this.query); + var query = loaderUtils.getOptions(this) || {}; if (_.isArray(query.multiple)) { query.multiple.forEach(function (subquery) { diff --git a/package.json b/package.json index b50ee26..95a1ecb 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ }, "main": "index.js", "dependencies": { - "loader-utils": "^0.2.11", + "loader-utils": "^1.0.4", "lodash": "^3.10.1" }, "devDependencies": {