Static Assets with Esbuild

In the GitHub - josevalim/phx_esbuild_demo - where esbuild is replacing the complete webpack ecosystem - I am still confused how the static folder will be handled. Any one figured it out? Earlier, webpack used to copy the contents of static folder to priv - and - they used to be served from there. What do we do now?

1 Like

I just flipped things around. All static assets are already in priv/static and the compiled assets go to priv/static/assets folder.

6 Likes

So, no need to have the static folder in the assets directory. Directly place them inside priv/static - Is that right @josevalim

Yes. it is working that way. priv/static is the folder where new static binary assets which need not be compiled are kept. I guess, the phx.digest generates fingerprints from these files.

2 Likes