Closed carbontwelve closed 4 months ago
This is likely to be fixed by #34. What I suspect to be happening is the compileOptions
is part of interlinker.templateConfig
set when 11ty triggers the eleventy.config
event. However when a new build begins that might be getting deleted or something along those lines. I'd chuck a debugger on the process to watch it happen during a build.
RenderManager
class internal to 11ty.Within the Render Plugin it will ignore templateConfig
passed through to the compile
function and set it from this
: see source.
This works the first time 11ty builds, but subsequent builds with --watch
cause the issue. I have been able to fix this in my website by modifying the interlinker plugin with the following:
eleventyConfig.on("eleventy.config", (cfg) => {
interlinker.templateConfig = cfg;
if (interlinker.rm) interlinker.rm.templateConfig = cfg;
});
This ensures that the RenderManager
is using the current template config.
Alternatively, instead of using the render plugin in a "hacky" way it might be possible to copy https://github.com/11ty/eleventy/blob/main/src/Plugins/RenderPlugin.js#L20-L52 into interlinker and forego the need to jury rig stuff.
When running 11ty in serve mode and making a change to a wikilink reference that prompts a rebuild the entire process crashes.
To clarify, this was when I was loading
![[ Building a self-contained game in C# under 2 kilobytes ]]
resulting in a broken embed, when I amended it to escape the#
the above crash happened during rebuild.