Hi,
I try to unpublish a blog post named "hello-world" from Contentful, it works well.
But I still have some files about the post I just unpublished as hello-world-_____.js, hello-world-_____.js.map
And the directory hello-world is still there but empty.
Why, how can clean everything?
Thanks



@Steffi3rd did you create a new build after unpublishing your blog post?
@Steffi3rd did you create a new build after unpublishing your blog post?
Yes I did.
Step 1 : unpublished
Step 2 : npm run dev
Step 3 : npm run build
Step 4 : npm run serve
And that's the result.
I think on new builds, the existing files in public folder aren't cleared. Is that correct @pieh?
Hmm, correct - we only delete .html files.
Hmm, correct - we only delete .html files.
Why???? :(
Even .js and .js.map are not delete?
I'm not 100% sure now, but I would think this edge case scenario might be the reason - consider scenario:
Someone visits your page and our runtime that fetches those files is loaded. While user is on the page you deploy new build (which deletes those .js files that our runtime depend on). Now when user tries to navigate to page you deleted (without refreshing), gatsby would try to fetch files that were deleted in meantime and it would fail with cryptic error (probably just in console - not visible to user) and what happens is page just doesn't load. So keeping old .js files is a way to not break site for people that that started navigating your site before you deployed new version with deleted page
@Steffi3rd I hope @pieh answered your question. It would be great if you can remove the content of your public folder and then build your website again.
@pieh In my opinion, we should have this in our documentation so that it's not a surprise for everyone. Or do we have it there already?
@kakadiadarpan @pieh Yes, I think he answered it, it seems weird anyway. Redirected to 404 or homepage, is not an option?
For example:
I only have 1 page index and 1 page blog.
Now look my tree... Starting to become a mess... 6 path---index (3 .js and.js.map)
It's okay about one of each... but 3 of each, I don't understand why, even with the explanation of @pieh.

Old issues will be closed after 30 days of inactivity. This issue has been quiet for 20 days and is being marked as stale. Reply here or add the label "not stale" to keep this issue open!
Hey again!
It鈥檚 been 30 days since anything happened on this issue, so our friendly neighborhood robot (that鈥檚 me!) is going to close it.
Please keep in mind that I鈥檓 only a robot, so if I鈥檝e closed this issue in error, I鈥檓 HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.
Thanks again for being part of the Gatsby community!