Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.

Commit 69b3c79

Browse files
committed
Add chunk name param only if query.name is set
1 parent f058eb3 commit 69b3c79

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

index.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ module.exports = function() {};
88
module.exports.pitch = function(remainingRequest) {
99
this.cacheable && this.cacheable();
1010
var query = loaderUtils.parseQuery(this.query);
11-
var options = {
12-
context: query.context || this.options.context,
13-
};
14-
var chunkName = loaderUtils.interpolateName(this, query.name, options);
15-
var chunkNameParam = ", " + JSON.stringify(chunkName);
11+
if(query.name) {
12+
var options = {
13+
context: query.context || this.options.context,
14+
};
15+
var chunkName = loaderUtils.interpolateName(this, query.name, options);
16+
var chunkNameParam = ", " + JSON.stringify(chunkName);
17+
} else {
18+
var chunkNameParam = '';
19+
}
1620
var result;
1721
if(query.lazy) {
1822
result = [

0 commit comments

Comments
 (0)