What is the difference between /assets/* /assets/static/*

I think the question title is self-explanatory but, to be on the safe side, I’ll explain a little bit more.

So I am making a project and I saw that my css works if I put it in the app.css in /assets/css or put with a custom filename in /assets/static/css. I can see that I can edit buildpack to add another file except app.css so I don’t really see any usage why to have /assets/static/. Is it because it will be dynamically added unlike standard /assets/ where I’d have to manually tell webpack what to do?

I am still new to the webapp world, so sorry for my lack of knowledge.

assets/static is used by the copywebpack plugin to transparently move from assets/static to priv/static, unchanged, just copied…

assets is the root of webpack builds.

Should I then mostly focus on using the /assets/static/ folder to put in custom files (or update anything which exists)? I know that it does copy to /priv/static/ but it works when files and in /assets/ as well. Is there anything more than just copying to /priv/static?


I just put there files that don’t need to pass through webpack pipeline.

As @kokolegorille said, it is a matter of “does it need any processing to be executed.”
Static files are files that do not need to go through any processing to be executed/interpreted by the browser. An image is an image, but Javascript and CSS have become much more complicated since the olden days. SCSS, modules, entry points, uglifiers, frameworks, …I am sure I am not even scratching the surface here.
Those files need to go through some kind of processing, which can be quite expensive computation wise.

Files like images can be used “as they are”, so they are considered “static” and can be ignored (which is not quite true, but close enough.)

I hope that helps :+1:

1 Like

Oh thank you! It makes way more sense now!