Added necessary tasks to the Gruntfile

This commit is contained in:
xavijam 2016-01-14 12:50:33 +01:00
parent c33b071e38
commit ab3ec9cd6f
2 changed files with 51 additions and 1 deletions

View File

@ -12,6 +12,32 @@ module.exports = function(grunt) {
}
}
},
connect: {
server: {
options: {
port: 9003,
livereload: 35732,
open: true,
hostname: '0.0.0.0', // to be able to access the server not only from localhost
base: {
path: '.'
}
}
}
},
clean: {
dist: {
files: [{
dot: true,
src: [
'.sass-cache',
'.tmp',
'dist',
'!dist/.git*'
]
}]
}
},
sass: {
dist: {
options: {
@ -40,6 +66,11 @@ module.exports = function(grunt) {
}
}
},
shell: {
dist: {
command: 'styleguide'
}
},
watch: {
scss: {
files: [
@ -58,8 +89,25 @@ module.exports = function(grunt) {
}
});
grunt.registerTask('default', ['sass', 'concat', 'cssmin', 'watch:scss']);
var baseTasks = [
'clean',
'sass',
'concat',
'cssmin'
];
var devTasks = baseTasks.concat([
'connect',
'watch:scss'
]);
grunt.event.on('watch', function (action, filepath) {
grunt.task.run('shell');
});
grunt.registerTask('dev', devTasks);
grunt.registerTask('build', baseTasks);
grunt.registerTask('default', baseTasks);
};
//

View File

@ -28,8 +28,10 @@
"highlight.js": "~9.1.0",
"markdown-styleguide-generator": "~2.0.4",
"grunt-sass": "1.1.0",
"grunt-contrib-clean": "0.7.0",
"grunt-contrib-concat": "0.5.1",
"grunt-contrib-cssmin": "0.14.0",
"grunt-contrib-connect": "0.11.2",
"grunt-contrib-watch": "0.6.1",
"grunt-shell": "1.1.2",
"load-grunt-tasks": "*"