Merge pull request #144 from xPaw/remove-grunt

Invoke handlebars outside of grunt, generate sourcemap
This commit is contained in:
Alistair McKinlay 2016-03-07 15:28:24 +00:00
commit d7738789af
3 changed files with 4 additions and 18 deletions

1
.gitignore vendored
View file

@ -3,5 +3,6 @@ npm-debug.log
# Built assets created at npm install/prepublish time
# See https://docs.npmjs.com/misc/scripts
client/js/libs.min.js.map
client/js/libs.min.js
client/js/lounge.templates.js

View file

@ -7,6 +7,7 @@ module.exports = function(grunt) {
},
uglify: {
options: {
sourceMap: true,
compress: false
},
js: {
@ -18,24 +19,8 @@ module.exports = function(grunt) {
});
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.registerTask(
"build",
function() {
grunt.util.spawn({
cmd: "node",
args: [
"node_modules/handlebars/bin/handlebars",
"client/views/",
"-e", "tpl",
"-f", "client/js/lounge.templates.js"
]
}, function(err) {
if (err) console.log(err);
});
}
);
grunt.registerTask(
"default",
["uglify", "build"]
["uglify"]
);
};

View file

@ -12,7 +12,7 @@
},
"scripts": {
"start": "node index",
"build": "grunt",
"build": "grunt && handlebars client/views/ -e tpl -f client/js/lounge.templates.js",
"test": "HOME=test/fixtures mocha test/**/*.js && npm run lint",
"lint": "eslint . && stylelint \"**/*.css\"",
"prepublish": "npm run build"