Commit 2ad1f0e6 authored by Valentin Hervieu's avatar Valentin Hervieu

Add a watch and serve task to grunt

parent b7a01c58
module.exports = function (grunt)
{
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
......@@ -62,7 +61,7 @@ module.exports = function (grunt)
url: function(url) {
return url.replace('src/', '');
},
bootstrap: function (module, script) {
bootstrap: function(module, script) {
return 'module.run(function($templateCache) {\n' + script + '\n});';
}
}
......@@ -98,6 +97,27 @@ module.exports = function (grunt)
}
]
}
},
watch: {
all: {
files: ['dist/*'],
options: {
livereload: true
}
},
js: {
files: ['src/*js', 'src/*.html'],
tasks: ['js']
},
less: {
files: ['src/*.less'],
tasks: ['css']
}
},
serve: {
options: {
port: 9000
}
}
});
......@@ -107,9 +127,11 @@ module.exports = function (grunt)
grunt.loadNpmTasks('grunt-angular-templates');
grunt.loadNpmTasks('grunt-replace');
grunt.loadNpmTasks('grunt-ng-annotate');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-serve');
grunt.registerTask('default', ['css', 'js']);
grunt.registerTask('css', ['recess']);
grunt.registerTask('js', ['ngtemplates','replace', 'ngAnnotate', 'uglify']);
grunt.registerTask('js', ['ngtemplates', 'replace', 'ngAnnotate', 'uglify']);
};
......@@ -19,6 +19,8 @@
"grunt-ng-annotate": "^1.0.1",
"grunt-recess": "~0.4.0",
"grunt-replace": "^0.11.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-serve": "^0.1.6",
"recess": "~1.1.9"
},
"author": "Rafal Zajac <rzajac@gmail.com>, Jussi Saarivirta <jusasi@gmail.com>, Angelin Sirbu <angelin.sirbu@gmail.com>",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment