Closed Zummer closed 2 years ago
{ test: /\.js$/, loader: 'string-replace-loader', options: { search: /__\w{6}\b/g, replace: function () { return `${current filename? or pathname?}`; // this.resourcePath ? }, },
where is this commit? I did not find it in project https://github.com/Va1/string-replace-loader/pull/55/commits/69f4c497ea03b9c4a84ff2f18513a6943931434a
@smartin85 's PR merged and released as v3.1.0. Replace function now has the context of the loader which allows for getting the filename beyond other things.