New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I get the entry file name in the loaders? #2090
Comments
I doubt this is possible unless the |
{
test: path.resolve("./images/test.png"),
loader: "file?name=hello.test.png"
} |
@sokra The project has multiple entry file,not just one.I want the built image name prefixs with its related entry file name?Can we make it? |
Seems duplicate to #1381. |
recursive issue references here #1381 is pointing back to this one each citing a duplicate of the other :) |
Finally, guys, is there a way to get entry point name in a custom loader? |
The only way, I found was to explore the
|
Thanks FuriouZz, here's a small modification to make it work with HMR as well: function findEntry(mod) {
if (mod.reasons.length > 0 && mod.reasons[0].module.resource) {
return findEntry(mod.reasons[0].module)
}
return mod.resource;
} |
This issue had no activity for at least half a year. It's subject to automatic issue closing if there is no activity in the next 15 days. |
Issue was closed because of inactivity. If you think this is still a valid issue, please file a new issue with additional information. |
@mcm-ham Your solution is not working anymore. Do you have any idea? |
Any updates on this issue?! |
why this._module is undefind ?? @mcm-ham |
If I have a entry
hello.js
like this:and I use
file-loader
to handle this, then I want the built image named as "hello.test.png",how can I make it?The following example can not fill my need:
The text was updated successfully, but these errors were encountered: