-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Media assets ignore folder structure #1938
Comments
I too found this really quite disturbing. Both for the reasons stated above and also because it's such a change with little or no benefit. |
#1887 - Original issue that caused the change |
I commented on that other issue but glad to see it's not just me. The silent overwriting of assets with the same name is dangerous, and it feels like a less organised way to deal with assets. |
Now I know it's the "Rails Way" with convention over configuration and all that, which I would usually subscribe to, but the default Webpack config that Webpacker produces is now ways away from what I need in my projects. And this means me having to make more than just changes to the webpacker config. Yes I know I can edit the config by adding/removing/merging config options, etc. but this is so messy and unwieldy. I also find that a YAML config AND the actual Webpack config is a conflicting construct. I've now got to the point where I simply want to create my own Webpack config from scratch, without any external forces making further (unwanted) changes. But I appreciate the conveniance of the server side support that Webpacker provides out of the box. Things like Rails integration, compilation, and deployment are hugely conveniant. So right now I'm exploring my own solution that will solve the above issues. |
I like the concept of organizing output files under js/css/media directories, but I agree that the original path should remain intact. This issue has been tripping me up when trying to upgrade to the RC because our project uses |
I talked about this in a long, recent mailing list post:
If you like the idea behind this, go promote the |
We just upgraded an app to RC7 and ran into the change to
asset_pack_path
where all assets are now collapsed into a singlemedia
directory. We use nested directories to namespace our assets and I find the new behavior surprising and potentially dangerous.For example, let's say we have two icons that each represent a component or module within our system.
Webpacker will copy both of these files to
media/icon.svg
with one overwriting the other. It was previously suggested to rename the images but that violates the conventions we have in our application. Additionally it would create either a junk drawer (every random file in the same directory) situation or a lot of name stuttering (projects/projects-icon.svg
).I believe the default should be to maintain the nesting that folks choose for their applications, allowing us to reference images in a way that matches that nesting and namespacing.
The text was updated successfully, but these errors were encountered: