Exclude files and directories from static site deployment

Hello there, I’ve published a static site on render.

My problem is that the repository contains unnecessary files such as package.json which shouldn’t be deployed.

I’ve gone to my render’s Settings and I’ve set the Publish directory to ./dist which contains the files that should be deployed.

However, package.json (as well as other files that are in the / folder) is still included when i visit https://.onrender.com/package.json

The only workaround I found is to create redirects, but that doesn’t sound right to me…

Any suggestions?

Hey Dimitri,

We continue to serve old files in order to prevent clients on the old version of the site from getting 404s when they request a resource that’s not in the new build. I’ve cleared your cache so those files shouldn’t stick around on your next build.

We’re revisting this setup since this there are some cases (like yours) where you don’t want to keep those old files around.

1 Like