The workaround was to initialize the nested vars object outside of the defineConfig() call, update it within setupNodeEvents, then set it on config.env.varsObject = varsObject
I'd like to understand why I can't instead update it in place if it's set on config.env to begin with