-
-
Notifications
You must be signed in to change notification settings - Fork 200
File-loader not works with different images with same name #73
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
Comments
Hey @shude! Hmm, yes, this makes sense. Without hacking in any changes, does simply enabling Encore versioning fix this ( Let me know! But, even if it does fix it... we might still want to make a change. And to answer your question, there's currently no way to override that rule in |
Thank you, @weaverryan! |
Wouldn't it be enough to allow people to use the @weaverryan You said on Slack that it could be an issue if, let's say, two scss files referenced the same image from a different folder. That shouldn't be the case since the final path is relative to a context that is the same for all the files handled by the loader. Edit : a small con with that solution though is that the |
Nevermind my previous comment, I thought about it a bit more and it'd probably be better to make it possible to override/disable the predefined image and font loaders entirely. |
…fault assets loaders (Lyrkan) This PR was squashed before being merged into the master branch (closes #110). Discussion ---------- Always add a hash to the name of the files created by the default assets loaders This PR modifies the configuration of the default assets loaders so a `[hash]` is always added to the output file names, even if versioning is disabled. It basically prevents having two files with the same name (but in a different directory) overwriting each other during build. This closes #73 and was further discussed in #103. Commits ------- d5cd482 Use [hash:8] for images and fonts filenames instead of [hash] 874235d Modify images/fonts loaders so a hash is always added to the name of output files
…kan) This PR was squashed before being merged into the master branch (closes #103). Discussion ---------- Allow to disable the default image and font loaders This PR adds a `disableAssetsLoaders` method to the API, allowing users to disable the default image and font loaders. Currently these two loaders are always added (with some parts of them being hardcoded) and can't really be overriden which can causes some issues (see #73). By allowing to disable this behavior, users would be able to replace them by their own loaders. About the new method: * **Why a `disableAssetsLoaders` and not an `enableAssetsLoaders` instead**: I still think that these two loaders should be added by default since almost every project will need them. Moreover, keeping them enabled will avoid breaking BC. * **Why a single method instead of one for the image loader and one for the fonts loader**: I may be wrong there, but I think that if an user disable one of them, it'll probably disable the other one aswell anyway. Commits ------- aeb4a95 Allow to disable the default image and font loaders
Hi.
I've 2 different images with same name:
In scss file i use both. File-loader copy only first image and skips second.
I have to rewrite the rule in config-generator.js to:
But is this a right way ?
Second question: how can i overwrite that rule in webpack.config.js ?
The text was updated successfully, but these errors were encountered: