Closed mdreizin closed 9 years ago
It helps to save loader this context during replacement. It is very useful in case when you need to have access to this context, for instance this.options:
this
this.options
{ test: /\.shtml$/, loader: StringReplacePlugin.replace('html-loader', { replacements: [{ pattern: /{{publicPath}}/gi, replacement: function () { return this.options.output.publicPath; } }] }) }
Thanks for the contribution; this is a nice improvement. I appreciate the tests as well.
I've rebased the branch and merged it in #8
It helps to save loader
this
context during replacement. It is very useful in case when you need to have access tothis
context, for instancethis.options
: