Expectation of global data and events #2062
Unanswered
cfjedimaster
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I was playing around with the new add eleventyConfig.addGlobalData feature and noticed you could not use it in beforeBuild. It doesn't throw an error, but if a template tries to make use of the variable it won't work.
Is this expected? To me, I'd expect it to work and create data available to templates.
Why would I use it here? Ok, so my particular use case probably wasn't a practical idea, but this is what I was doing:
Basically a global data variable that stored the keys of all available other global data variables. I only tried it here as I noticed similar code in the main function only worked right if placed after every other call.
Beta Was this translation helpful? Give feedback.
All reactions