maxparm / node-underscorify

Underscore template pre-compiler for browserify
MIT License
31 stars 12 forks source link

Underscore not global #6

Closed veacks closed 10 years ago

veacks commented 10 years ago

Hi, node-underscorify works like charm if underscore is set as global, but I need to use it locally for my modules, how can I setup underscore with shim when I require my templates ?

I tried something like that in my grunt file but unfortunately it doesn't work :

Grunt file

shim: {
underscore:  {
  path: 'vendor/underscore/underscore.js',
  exports: '_'
},
templates: {
  path: 'templates/**/*.html',
  exports: null,
  depends: {
       underscore: 'underscore'
 }
}

Module file

var _ = require('underscore');
var MyTemplates = require('templates/my-template.html');

Thanks.