Skip to content

Commit

Permalink
Use never version of loader injection into "after-resolve" NMF
Browse files Browse the repository at this point in the history
Refs #289
  • Loading branch information
NekR committed Apr 28, 2018
1 parent 65edf58 commit 7b29577
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,10 @@ var OfflinePlugin = (function () {
data[key] = tool.getConfig(_this2);
});

result.loaders.push(_path3['default'].join(__dirname, 'misc/runtime-loader.js') + '?' + JSON.stringify(data));
result.loaders.push({
loader: _path3['default'].join(__dirname, 'misc/runtime-loader.js'),
options: JSON.stringify(data)
});

callback(null, result);
};
Expand Down
2 changes: 1 addition & 1 deletion lib/misc/sw-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = function () {};
module.exports.pitch = function pitch(remainingRequest, precedingRequest, data) {
var _this = this;

this.cacheable && this.cacheable();
this.cacheable && this.cacheable();;

var callback = this.async();
var templatePath = path.join(__dirname, 'sw-template.js');
Expand Down
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ export default class OfflinePlugin {
data[key] = tool.getConfig(this);
});

result.loaders.push(
path.join(__dirname, 'misc/runtime-loader.js') +
'?' + JSON.stringify(data)
);
result.loaders.push({
loader: path.join(__dirname, 'misc/runtime-loader.js'),
options: JSON.stringify(data)
});

callback(null, result);
};
Expand Down

0 comments on commit 7b29577

Please sign in to comment.