{"action":"opened","issue":{"url":"https://api.github.com/repos/patrickkettner/grunt-compile-handlebars/issues/49","labels_url":"https://api.github.com/repos/patrickkettner/grunt-compile-handlebars/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/patrickkettner/grunt-compile-handlebars/issues/49/comments","events_url":"https://api.github.com/repos/patrickkettner/grunt-compile-handlebars/issues/49/events","html_url":"https://github.com/patrickkettner/grunt-compile-handlebars/issues/49","id":61044309,"number":49,"title":"Handlebars & global data not accessible from helper files","user":{"login":"jenniferlsharps","id":3217580,"avatar_url":"https://avatars.githubusercontent.com/u/3217580?v=3","gravatar_id":"","url":"https://api.github.com/users/jenniferlsharps","html_url":"https://github.com/jenniferlsharps","followers_url":"https://api.github.com/users/jenniferlsharps/followers","following_url":"https://api.github.com/users/jenniferlsharps/following{/other_user}","gists_url":"https://api.github.com/users/jenniferlsharps/gists{/gist_id}","starred_url":"https://api.github.com/users/jenniferlsharps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenniferlsharps/subscriptions","organizations_url":"https://api.github.com/users/jenniferlsharps/orgs","repos_url":"https://api.github.com/users/jenniferlsharps/repos","events_url":"https://api.github.com/users/jenniferlsharps/events{/privacy}","received_events_url":"https://api.github.com/users/jenniferlsharps/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-13T11:34:58Z","updated_at":"2015-03-13T11:34:58Z","closed_at":null,"body":"I'm trying to access Handlebars.partials inside of a helper, but I can't access Handlebars in my helper (it's undefined).\r\n\r\nMy workaround right now is to require Handlebars within my helper (as I was trying to follow the source code, and it seems this is how it's been implemented), but this has gotten messy as well since the path to Handlebars instance is at a location not relative to my helper files, but relative to grunt files.\r\n\r\nI thought I could make it work by setting some global data in the grunt task which sets the handlebars path, but the global variable was also not available in my helper file unless the helper was called from the root context! To get around this, my grunt task is actually writing a JSON file with my global data into a directory accessible to the helper files.  This is not ideal!  My code looks something like this (where '../global' is a file containing my global json data written on the fly):\r\n\r\nvar handlebarsPath = require('../global')['handlebarsPath'];\r\nvar Handlebars = require(handlebarsPath);\r\n\r\nAm I missing something?  There surely should be some way for my helpers to access:\r\n1. the Handlebars instance\r\n2. 'globals' data, regardless of context"}}