Invoke handlebars outside of grunt, generate sourcemap

Fixes #65
This commit is contained in:
Pavel Djundik 2016-03-05 21:32:27 +02:00
parent 05cd5ac4a5
commit 1dd4e4f031
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"