Skip to content

Commit 7587754

Browse files
AaronFrieljantimon
authored andcommittedMar 1, 2018
Fix to work with loader-utils ^1.1.0 (#792)
fix(query-loader): In case no query is provided, return an empty object. This fixes #727
1 parent 17b6f19 commit 7587754

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎lib/loader.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = function (source) {
2424
// The following part renders the tempalte with lodash as aminimalistic loader
2525
//
2626
// Get templating options
27-
const options = loaderUtils.parseQuery(this.query);
27+
const options = this.query !== '' ? loaderUtils.parseQuery(this.query) : {};
2828
// Webpack 2 does not allow with() statements, which lodash templates use to unwrap
2929
// the parameters passed to the compiled template inside the scope. We therefore
3030
// need to unwrap them ourselves here. This is essentially what lodash does internally

0 commit comments

Comments
 (0)
Please sign in to comment.