Closed pamtbaau closed 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.
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"
}
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
)?
Will do some more tests and get back to you....
Same thing happens with eleventy --serve
? YES
Same thing happens when running npx eleventy --watch
directly (instead of npm run watch)? YES
@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.
@zachleat This is what I did:
Website looks as expected. It shows 3 latest posts at bottom.
Changed eleveny.js
, by setting n
hardcoded:
// Get the first `n` elements of a collection.
eleventyConfig.addFilter("head", (array, n) => {
n = 1; <-- Changed the number of posts to return
if( n < 0 ) {
return array.slice(n);
}
return array.slice(0, n);
});
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.
After a bit of wrangling, I don’t think this is limited to Windows.
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.
Windows 10 Node 11.4.0
Downloaded starter 'eleventy-base-blog'
It seems that
npm run watch
does not process changes ineleventy.js
. Although changes ineleventy.js
are being detected and files are being written to '_site'...npm run build
does process any change into the site.