-
Notifications
You must be signed in to change notification settings - Fork 808
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
Assets file name collision #3061
Comments
Why do you not only make subfolders for each component and copy it directly to the public dir? |
I think this is something we should fix as an opt in. But I also think the only proper way to do this is to include the hash in the filename itself and not in a query string for the file in the manifest. If we do this it'll be in tandem with the switch to asset modules (see #3059). |
Because there is no reason to not use imports. In our case, it's about Vue components, but the problem is not about Vue only.
is much simpler than worry about dist folders structure. |
You really mean something like:
is easier to understand and maintain as something like:
|
@Moriarty1982 in the current setup the 2nd import would result in asset collisions because the image names are both |
Ok I had use something like
and then in the component:
to get the pictures for the component, no hash is needed with this. |
Yes, that is an alternative option. But there are reasons one might not want to go that route. Either way it is something we change. |
The problem appears when for example you're referencing the logo of your website in different components. A similar workaround to the one mentioned in this issue, is attached to the issue I opened as well |
@thecrypticace does the code I noted in my reply here help? We had a similar issue with WPEmerge theme where assets weren't getting copied with subfolders. It needs another implementation here for relative paths: |
I want to open this issue again with one more case #2910
We have vue components and each component can have its own assets inside the components folder.
It was a matter of time when we come to a situation when two different components have two different images with the same name. Rename images? It's not a solution anyway.
For now, we use this temp workaround:
I have read the argument here #2911 (comment)
But why not do it optional? Just add
addHashToFilenames
option with default false value.The text was updated successfully, but these errors were encountered: