require external deps inside task

This commit is contained in:
Tyler Kellen 2012-09-10 17:32:35 -05:00
parent f0d8e0fcdf
commit e8c7b372e8

View File

@ -10,9 +10,6 @@
module.exports = function(grunt) {
"use strict";
var _ = require("underscore");
var helpers = require("grunt-contrib-lib").init(grunt);
var jst = function(source, filepath, namespace, templateSettings) {
try {
return namespace + "['" + filepath + "'] = " + _.template(source, false, templateSettings).source + ";";
@ -23,6 +20,9 @@ module.exports = function(grunt) {
};
grunt.registerMultiTask("jst", "Compile underscore templates to JST file", function() {
var _ = require("underscore");
var helpers = require("grunt-contrib-lib").init(grunt);
var options = helpers.options(this, {namespace: "JST", templateSettings: {}});
grunt.verbose.writeflags(options, "Options");