11ty / eleventy

A simpler site generator. Transforms a directory of templates (of varying types) into HTML.
https://www.11ty.dev/
MIT License
16.84k stars 487 forks source link

Watch does not reprocess eleventy.js #340

Closed pamtbaau closed 5 years ago

pamtbaau commented 5 years ago

Windows 10 Node 11.4.0

Downloaded starter 'eleventy-base-blog'

It seems that npm run watch does not process changes in eleventy.js. Although changes in eleventy.js are being detected and files are being written to '_site'...

npm run build does process any change into the site.

jevets commented 5 years ago

Looks like watch does watch .eleventy.js in version 0.6.0.

Maybe it's time to bump up the base blog dependency.

pamtbaau commented 5 years ago

Forgot to mention that I upgraded all npm dependencies to the latest versions.

  "devDependencies": {
    "@11ty/eleventy": "^0.6.0",
    "markdown-it": "^8.4.2",
    "markdown-it-anchor": "^5.0.2"
  }
jevets commented 5 years ago

Hmmm, wonder if it's a Windows specific issue? It watches .eleventy.js and reloads for me on Mac on Node 10.14.x and Eleventy 0.6.0.

Probably need @zachleat on this one

Same thing happens with eleventy --serve? Same thing happens when running npx eleventy --watch directly (instead of npm run watch)?

pamtbaau commented 5 years ago

Will do some more tests and get back to you....

pamtbaau commented 5 years ago

Same thing happens with eleventy --serve? YES Same thing happens when running npx eleventy --watch directly (instead of npm run watch)? YES

zachleat commented 5 years ago

@pamtbaau What changes did you make to .eleventy.js? Can you be more specific there? It should reprocess but there may be a bug in an individual option not being reset or updated correctly.

pamtbaau commented 5 years ago

@zachleat This is what I did:

Website looks as expected. It shows 3 latest posts at bottom.

The change triggers the watch and a new site is being generated.

When npm run build is run, the number of posts shown is correct. When restarting npm run watch, the number of posts shown is correct.

zachleat commented 5 years ago

After a bit of wrangling, I don’t think this is limited to Windows.

zachleat commented 5 years ago

I did some checking at the commit at https://github.com/11ty/eleventy/commit/8610d473deca4e4e7853e0617764f462ec15b179 does apply and fix 0.7.1 as well. So this will be included with upcoming 0.7.2.