how can i exclude files to being regenerated by do

2019-06-03 08:58发布

问题:

I'm working in a new skeleton for docpad using zurb's foundation 4.

you can check it out the progress here: https://github.com/dospuntocero/zurb-foundation.docpad

but every time i do a small change on the files it takes 8-12 seconds to regenerate files and it regenerate 47 files... no idea which ones (im just modifying one)

info: Generating...
info: Generated 47 files in 11.013 seconds
info: Regenerated at 22:15:08
info: Regenerating at 22:16:59
info: Generating...
info: Generated 47 files in 9.551 seconds
info: Regenerated at 22:17:09
info: Regenerating at 22:22:48

so it's kind of super slow, almost unusable. i'm using foundation 4 as a git submodule.

回答1:

If you modify a file, DocPad will also regenerate all files that reference other files, that being documents that do something like @getCollection, @include, @getDatabase, whatnot. It also includes stylsheets, as if I modify a stylesheet, I would expect that the stylesheets that import that stylesheet are also regenerated.

We can make this more intelligent, by keeping track of exactly which files documents reference. There is a discussion here about how we could accomplish such a thing - https://github.com/bevry/docpad/issues/336 - but it is a difficult task.

For the meantime, you can add standalone: true to your document's meta data - more info here. That will tell DocPad to only regenerate that one file, rather than all files that could possibly reference it. I use that a lot during development especially if I am modifying a particular file like crazy, then I remove them once development has settled down to ensure that file is always generated properly.



标签: docpad