Reputation: 116
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.
Upvotes: 8
Views: 1215
Reputation: 2628
This worked for me in dev mode:
module.exports = function loader(source) {
const file = this._module.resource;
...
}
Upvotes: 1