I am writing a custom loader and need the ability to get the name of the entry file inside the loader. This question has been asked on webpack github twice and on file-loader githib once already.
This worked for me in dev mode:
module.exports = function loader(source) {
const file = this._module.resource;
...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With