SlexAxton / require-handlebars-plugin

A plugin for handlebars in require.js (both in dev and build)
804 stars 202 forks source link

Helper paths being overwritten #233

Open benwalsh opened 9 years ago

benwalsh commented 9 years ago

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.

chrisrink commented 8 years ago

It defaults to templates/helpers but can be overwritten with requirejs.config.hbs.helperDirectory