unic / estatico

[DEPRECATED] Estático – Static site generator for frontend unicorns
Other
121 stars 18 forks source link

HTML Watch Task: Rebuilding pages + index is broken #34

Closed swey closed 7 years ago

swey commented 7 years ago
backflip commented 7 years ago

I guess https://github.com/unic/estatico/blob/develop/gulp/html/default.js#L79-L112 does not work for the index since it requires globs instead of specific files.

One approach would be building the index file every time something changes. However, we have projects with so many modules that it takes multiple seconds to build the index (or loading index.data.js as a matter of fact).

I usually just save index.hbs manually since it didn't have a better idea so far...

backflip commented 7 years ago

On second thought: Always rebuilding the index would probably be a good default. In case of performance issues this could be disabled manually.

swey commented 7 years ago

I slightly modified the issue: Also the rebuilding of the pages is broken.

For everyone running into the same problem as long there is no fix: --skipHtmlDependencyGraph is a possibility to disable the dependency graph and make a full rebuild every time

backflip commented 7 years ago

I cannot reproduce the issue with pages not being rebuilt (e.g. changing demo/modules/teaser/teaser.hbs will rebuild demo/pages/page/page.html for me). What does your page look like?

swey commented 7 years ago

Ok, figured out the problem:

{{> modules/one/one modules.one }}
{{> "modules/two/two" modules.two }}

The version without the quotes is not working (that's the one we are using)

swey commented 7 years ago

PR #41 has a more flexible pattern.

The only remaining problem is that it's not working for modules that are used in the layout.hbs (like a header), but for that case I just would recommend using --skipHtmlDependencyGraph while developing such modules.