0

Would anyone happen to know how to change the default define(['whatever'] path on the compiled handlebars templates?

At the moment Mimosa compiles my .hbs files to a single .js file and everything works ok - except that I'm using requirejs and the define path Mimosa gives is a complete path to handlebars.js file instead of simply "handlebars" as I would like it to be.

It's now

define(['home/blaaahblaah/www/project/public/vendor/javascripts/handlebars'], function (Handlebars){

instead of

define(['handlebars'], function (Handlebars){

This sucks because now I have to manually change the define every time something changes in the .hbs files...

I bet this can be changed somewhere in the mimosa-config file but I wouldn't know where or how...

QlliOlli
  • 637
  • 3
  • 13
  • 25

1 Answers1

0

Have you tried putting handelbars:"home/blaaahblaah/www/project/public/vendor/javascripts/handlebars" in your requirejs paths? Mimosa should use that.

Could you toss an example repo up on github? Would love to help figure out why its putting that path in.

David Bashford
  • 605
  • 4
  • 6
  • I do have a path for handlebars in my requirejs main file: 'handlebars': 'vendor/javascripts/handlebars/handlebars' and it works as expected everywhere else. It's just that when using wrapType: "amd" Mimosa seems to add some kind of a default path to my compiled template files instead of using simply 'handlebars'. I wonder if there was a way to define this dependency myself somehow.. Codewise there's not much to see, as I'm only referring to the precompiled file in my view files (I'm using backbone / marionette here) - Mimosa is doing that precompiling for me. – QlliOlli Dec 11 '13 at 12:14
  • + I don't really get where this 'home/blaaahblaah/www/project/public/vendor/javascripts/handlebars' path comes from, as the real path to my handlebars.js file would be 'home/blaaahblaah/www/project/public/vendor/javascripts/handlebars/handlebars' (notice the extra directory in the end, which is missing from that Mimosa given path... – QlliOlli Dec 11 '13 at 12:18
  • If you were to add an example repo up somewhere I could see if I could duplicate your problem and possibly see what the root issue is. – David Bashford Jan 07 '14 at 19:49