Missing getOptions.js in lib ?
geOptions was removed https://github.com/webpack/loader-utils/releases/tag/v3.0.0
removed getOptions in favor loaderContext.getOptions (loaderContext is this inside loader function), note - special query parameters like ?something=true is not supported anymore, if you need this please do it on loader side, but we strongly recommend avoid it, as alternative you can use ?something=1 and handle 1 as true
@alexander-akait can we get a test/example on how to migrate getOptions to the new syntax?
this.getOptions, this is loaderContext inside loader function
this.getOptions,thisis loaderContext inside loader functionthis.getOptions
It really works for me. But I don't think it makes sense to just delete loaderUtils.getOptions(this).
module.exports = function cultureLoader(source) {
// get loader options, replace const options = loaderUtils.getOptions(this);
const options = this.getOptions();
const { sensitiveWord } = options;
var callback = this.async();
callback(null, source.replace(sensitiveWord, ''.padEnd(sensitiveWord.length, '*')));
}
You should use this.getOptions instead loaderUtils.getOptions(this), now it is a part of webpack logic