Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace loaderUtils.parseQuery with loaderUtils.getOptions #409

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/misc/sw-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ module.exports.pitch = function pitch(remainingRequest, precedingRequest, data)

var callback = this.async();
var templatePath = path.join(__dirname, 'sw-template.js');
var query = loaderUtils.parseQuery(this.query);
var params = JSON.parse(query.json);
var options = loaderUtils.getOptions(this);
var params = JSON.parse(options.json);

var request = loaderUtils.stringifyRequest(this, remainingRequest);
var source = 'module.exports = require(' + request + ')';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"dependencies": {
"deep-extend": "^0.5.1",
"ejs": "^2.3.4",
"loader-utils": "0.2.x",
"loader-utils": "^1.1.0",
"minimatch": "^3.0.3",
"slash": "^1.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions src/misc/sw-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ module.exports.pitch = function pitch(remainingRequest, precedingRequest, data)

const callback = this.async();
const templatePath = path.join(__dirname, 'sw-template.js');
const query = loaderUtils.parseQuery(this.query);
const params = JSON.parse(query.json);
const options = loaderUtils.getOptions(this);
const params = JSON.parse(options.json);

const request = loaderUtils.stringifyRequest(this, remainingRequest);
const source = 'module.exports = require(' + request + ')';
Expand Down