Problem with beforeBuild and fse.copySync (fs-extra), when rebuilding... endless loop of rebuilding. #2160
-
Note: I'm not quite sure if this belongs to Issues or Discussions. But assuming the problem lies in my code I have posted it here. Also too much to post in Eleventy's Discord. Objective Manually, permalinks or one off script beforeBuild functions Endless loop of rebuilding Inside .eleventy.js:
The index.njk is loading a layout from _includes/layouts
Array from sites.json:
So when doing the first build there's no problem but when rebuilding Eleventy keeps seeing a save. So somewhere there's some conflicting. Any ideas what the problem and solution could be? I've already pretty much decided it would probably be better to make this a script that could be started with an npm run command. Only when needed, to copy everything necesarry to the (input) src folder. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
So I have solved the problem by moving the copySync code from above into it's own file; titles.js. I'm content with this solution. But, the beforeBuild problem when rebuilding with the copySync code in .eleventy.js –– is this a bug in Eleventy or is this caused because I might be using it in an unintentional way? |
Beta Was this translation helpful? Give feedback.
So I have solved the problem by moving the copySync code from above into it's own file; titles.js.
This file is called with 'npm run titles'... or optional in combination with 'npm run start' or 'npm run build' scripts (in package.json).
I'm content with this solution.
But, the beforeBuild problem when rebuilding with the copySync code in .eleventy.js –– is this a bug in Eleventy or is this caused because I might be using it in an unintentional way?