I is it possible to retrieve information about the file context where the replace is happening? Just like this:
module.exports = {
// ...
module: {
rules: [
{
test: /\.js$/,
loader: 'string-replace-loader',
options: {
search: '%%FILE_PATH%%',
replace(match, p1, offset, string) {
// Is there a way to get FULL_FILE_PATH like `/src/components/button.js?
// the file that match rule's test
return FULL_FILE_PATH;
},
flags: 'g'
}
}
]
}
}
I is it possible to retrieve information about the file context where the replace is happening? Just like this: