Skip to content
This repository was archived by the owner on Mar 17, 2021. It is now read-only.

Can we have the name of the chunk in the filename template placeholder? #28

Closed
TrustNik opened this issue Jul 20, 2015 · 7 comments
Closed

Comments

@TrustNik
Copy link

Smth like:
loader: "file-loader?name=[chunkname]_[name].[ext]"

Or is there a workaround to achieve that?

@bcharp
Copy link

bcharp commented Apr 26, 2016

I'm interested too.

@alexander-akait
Copy link
Member

@TrustNik @bcharp can you describe use case?

@cxyxc
Copy link

cxyxc commented Sep 11, 2017

When my html files in different levels, I wish [chunkname] to differentiate different chunks to add different publicPath .

@jezeniel
Copy link

jezeniel commented Sep 26, 2017

@evilebottnawi This would also be useful when you use webpack with django, you need predictable filenames to load static files so hashes are a no-no.

On large projects there are instances that assets will have similar filenames, this would serve as a namespace to prevent filename conflict. And i think this issue is also similar to #114.

@alexander-akait
Copy link
Member

@sokra Is it possible to implement this in loader or have workaround?

@joshwiens
Copy link
Member

If someone wants to PR in a change & tests for this, we will consider it.

@micgro42
Copy link

micgro42 commented Aug 7, 2018

This seems to be impossible on a fundamental level. The apparently correct approach (which worked for me, after several hours of searching) is to implement "multiple configurations".
Source: webpack/webpack#6124 (comment)
Doku: https://webpack.js.org/configuration/configuration-types/#exporting-multiple-configurations

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants