Compile templates with grunt
This commit is contained in:
parent
b463ec7489
commit
a406e52721
18
Gruntfile.js
18
Gruntfile.js
@ -18,8 +18,24 @@ module.exports = function(grunt) {
|
||||
});
|
||||
grunt.loadNpmTasks("grunt-contrib-uglify");
|
||||
grunt.loadNpmTasks("grunt-contrib-watch");
|
||||
grunt.registerTask(
|
||||
"handlebars",
|
||||
function() {
|
||||
grunt.util.spawn({
|
||||
cmd: "node",
|
||||
args: [
|
||||
"node_modules/handlebars/bin/handlebars",
|
||||
"client/views/",
|
||||
"-e", "tpl",
|
||||
"-f", "client/js/shout.templates.js"
|
||||
]
|
||||
}, function(err) {
|
||||
if (err) console.log(err);
|
||||
});
|
||||
}
|
||||
);
|
||||
grunt.registerTask(
|
||||
"default",
|
||||
["uglify"]
|
||||
["uglify", "handlebars"]
|
||||
);
|
||||
};
|
||||
|
18
build.sh
18
build.sh
@ -1,18 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# This file will compile the javascript libraries and
|
||||
# the Handlebars templates.
|
||||
#
|
||||
|
||||
# Install Handlebars
|
||||
if ! type handlebars &> /dev/null; then
|
||||
sudo npm -g install handlebars
|
||||
fi
|
||||
|
||||
# Compile the templates
|
||||
handlebars -e tpl -f client/js/shout.templates.js client/views/
|
||||
|
||||
# Uglify the javascript libraries
|
||||
# See: Gruntfile.js
|
||||
grunt uglify
|
@ -47,6 +47,7 @@
|
||||
"devDependencies": {
|
||||
"grunt": "~0.4.5",
|
||||
"grunt-contrib-uglify": "~0.5.0",
|
||||
"grunt-contrib-watch": "^0.6.1"
|
||||
"grunt-contrib-watch": "^0.6.1",
|
||||
"handlebars": "^2.0.0"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user