Skip to content

Commit

Permalink
Updated loader-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
baderbuddy committed Jun 15, 2017
1 parent de2263f commit d5690b9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';

var loaderUtils = require('loader-utils');
var Hogan = require('hogan.js');
var minifier = require('html-minifier');
Expand All @@ -16,7 +15,7 @@ var minifierDefaults = {
};

module.exports = function(source) {
var query = loaderUtils.parseQuery(this.query);
var query = loaderUtils.getOptions(this);
var hoganOpts = extend(query, { asString: true });
delete hoganOpts.minify;
delete hoganOpts.noShortcut;
Expand Down Expand Up @@ -55,7 +54,7 @@ module.exports = function(source) {
};
module.exports.pitch = function(remainingRequest, precedingRequest, data) {
if (remainingRequest.indexOf('!') >= 0) {
var query = loaderUtils.parseQuery(this.query);
var query = loaderUtils.getOptions(this.query);
var hoganOpts = extend(query);
delete hoganOpts.minify;
delete hoganOpts.noShortcut;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
"dependencies": {
"hogan.js": "^3.0.2",
"html-minifier": "^3.1.0",
"loader-utils": "^0.2.4",
"loader-utils": "^1.1.0",
"xtend": "^4.0.0"
},
"devDependencies": {
"eslint": "^3.6.1",
"jscs": "^3.0.7",
"mocha": "^3.1.0",
"chai": "^3.5.0"
"chai": "^4.0.0"
},
"scripts": {
"pretest": "eslint index.js && jscs index.js",
Expand Down
4 changes: 2 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("MustacheLoader", function () {
done(err);
return;
}
var results = mustacheLoader.apply({}, [data]);
var results = mustacheLoader.apply({query : {}}, [data]);
var module = {};
eval(results);
expect(module.exports).to.not.be.undefined;
Expand Down Expand Up @@ -38,7 +38,7 @@ describe("MustacheLoader", function () {
done(err);
return;
}
var results = mustacheLoader.apply({query: { minify: true}}, [data]);
var results = mustacheLoader.apply({query: "?minify"}, [data]);
var module = {};
eval(results);
expect(module.exports).to.not.be.undefined;
Expand Down

0 comments on commit d5690b9

Please sign in to comment.