Skip to content

Commit

Permalink
Fix to work with loader-utils ^1.1.0 (#792)
Browse files Browse the repository at this point in the history
fix(query-loader): In case no query is provided, return an empty object. This fixes #727
  • Loading branch information
AaronFriel authored and jantimon committed Mar 1, 2018
1 parent 17b6f19 commit 7587754
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = function (source) {
// The following part renders the tempalte with lodash as aminimalistic loader
//
// Get templating options
const options = loaderUtils.parseQuery(this.query);
const options = this.query !== '' ? loaderUtils.parseQuery(this.query) : {};
// Webpack 2 does not allow with() statements, which lodash templates use to unwrap
// the parameters passed to the compiled template inside the scope. We therefore
// need to unwrap them ourselves here. This is essentially what lodash does internally
Expand Down

0 comments on commit 7587754

Please sign in to comment.