Skip to content

Building doesn't seem to remove files that I deleted in the project from the _site directory. #2294

Answered by pdehaan
arpeasal asked this question in Q&A
Discussion options

You must be logged in to vote

Correct, Eleventy doesn't delete the dir.output folder before each build.
We have a few existing issues around that, for your reading pleasure:

Personally I either do a prebuild script in my package.json file (which automatically gets run before npm run build script) which runs rm -rf www/, which works for me on macOS. If you want to be fancier (and more cross-env compatible) you could also use the rimraf or del modules in your .eleventy.js file. Not sure how that impacts Eleventy incremental builds, probably quite poorly; but I personally don't use incremental builds so #yolo.

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
5 replies
@arpeasal
Comment options

@pdehaan
Comment options

pdehaan Mar 28, 2022
Collaborator

@arpeasal
Comment options

@arpeasal
Comment options

@pdehaan
Comment options

pdehaan Mar 30, 2022
Collaborator

Answer selected by arpeasal
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@Ryuno-Ki
Comment options

@hozza
Comment options

@Ryuno-Ki
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants