require-handlebars-plugin
require-handlebars-plugin copied to clipboard
Helper paths being overwritten
I am using requirejs-rails but I think the issue is not there, but here.
I have my Javascript app in a /app/assets/javascripts/fn/* directory. Handlebars is loading, the require-handlebars-plugin is loading, and my hbs templates are loading. But then the moduleTree encounters a helper, and it blows up:
{ [Error: Error: ENOENT, no such file or directory '/var/rails/myapp/releases/20150528174835/tmp/requirejs/dst/templates/helpers/t.js'
In module tree:
some-file
some-dependency
hbs
But the file is not located at templates/helpers/t.js, it's located at fn/templates/helpers/t.js. I have even abstracted the direct call out; the JS file is including hbs-translation-helper, and in the requireJS config, that path is resolving to: "fn/templates/helpers/t". So why would it be looking in a top-level templates/ directory which isn't there?
I have tried setting:
hbs:
helpers: false
but no luck.
It defaults to templates/helpers but can be overwritten with requirejs.config.hbs.helperDirectory