How can I get the entry file name in the loaders?
See original GitHub issueIf I have a entry hello.js
like this:
require('./images/test.png');
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:
{
test: /\.(jpe?g|png|gif|svg)$/i,
loaders: ['file?hash=sha512&digest=hex&name=[path][hash].[ext]']
}
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:13 (3 by maintainers)
Top Results From Across the Web
webpack - How can I get the entry file name in the loaders?
I am writing a custom loader and need the ability to get the name of the entry file inside the loader. This question...
Read more >file-loader - webpack - JS.ORG
Specifies a Regular Expression to one or many parts of the target file path. The capture groups can be reused in the name...
Read more >长期缓存 | webpack
Webpack can add hashes for the files to the filename. Loaders that emit files (worker-loader, file-loader) already do this. ... entry output.
Read more >Output - webpack 3 documentation
This option determines the name of non-entry chunk files. ... Automatic and explicit loaders and params up to the name of the first...
Read more >Webpack: an introduction - ts - GUIDE - Angular
You supply Webpack with one or more entry files and let it find and ... pattern matches the filename, Webpack processes the file...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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?