elmstatic icon indicating copy to clipboard operation
elmstatic copied to clipboard

elmstatic watch deletes the whole _site dir

Open eimfach opened this issue 5 years ago • 2 comments

Hi there, I want to use the watch mode with postcss, but 'elmstatic watch' deletes the whole _site directory, which leads to awkward behaviour when I am also generating css via postcss-cli into the _site directory. Would it be possible to only copy the file which actually changed ?

eimfach avatar Oct 29 '19 01:10 eimfach

I tried going down that road but it's not straightforward (eg changing a post also changes the post list, and all the related tag pages). I discuss it in this post: https://korban.net/posts/elm/2019-07-09-elmstatic-better-performance-live-reload/

I'd be willing to consider a PR though.

alexkorban avatar Oct 29 '19 04:10 alexkorban

Hm yes, I see. So in general it is not easy for me what happens under the hood... do you generate the html with the elm runtime running in node.js and providing the dom via js-dom?

also, I think it could be possible to to be explicit which folders are wiped in the _site dir. If I understand that correctly you could only wipe the directories with .html files ?

eimfach avatar Oct 29 '19 12:10 eimfach