Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

develop loop not running when /content folder changes for non .md file. #78

Closed
rupertlssmith opened this issue Mar 10, 2020 · 3 comments

Comments

@rupertlssmith
Copy link

I have been using elm-markup and had an index.emu file under /content.

I notived that under elm-pages develop changes to this file do not trigger the build loop, but they do for an index.md file.

Some suggested fixes:

  1. Trigger the build loop on any change under /content. Not as refined as 2, but should be perfectly effective and not unreasonable.
  2. Trigger the build loop on any change to files with a DocumentHandler for that file type. I guess this is harder to do.

Workaround: Just call your files .md, even if you are using elm-markup.

@rupertlssmith
Copy link
Author

Strange that I am seeing this behaviour, as I can see already that the file watch is looking for changes in anything under /content:

https://github.com/dillonkearns/elm-pages/blob/master/generator/src/elm-pages.js#L150

watcher = chokidar
      .watch(["content/**/*.*"],

@rupertlssmith
Copy link
Author

Just tried a little experiment.

  1. I renamed index.md to index.txt and changed the extension field on its handler to "txt". Changes to the index.txt file triggered build loops.

  2. I renamed index.md to index.emu and changed the extension field on its handler to "emu". Changes to the index.emu file did not trigger build loops.

.emu stuff seems to be excluded from the file watch, even though the file watch seems to be over anything under /content.

Makes me suspicious that this line could be having weird side-effects:
https://github.com/dillonkearns/elm-pages/blob/master/generator/src/elm-pages.js#L52

@dillonkearns
Copy link
Owner

Thanks for filing this @rupertlssmith, I'm working on a release that will include a fix for this. I'll be folding the .emu handling into the common content/ folder handling so it will use all the same codepaths instead of having special cases 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants