CartoAssets/Gruntfile.js

37 lines
854 B
JavaScript
Raw Normal View History

2016-01-14 20:57:13 +08:00
module.exports = function (grunt) {
2016-01-14 19:14:43 +08:00
require('load-grunt-tasks')(grunt);
grunt.initConfig({
2016-01-14 20:57:13 +08:00
concat: require('./tasks/concat'),
connect: require('./tasks/connect'),
clean: require('./tasks/clean'),
sass: require('./tasks/sass'),
cssmin: require('./tasks/cssmin'),
shell: require('./tasks/shell'),
2016-01-15 05:17:06 +08:00
watch: require('./tasks/watch'),
'gh-pages': require('./tasks/gh-pages')
2016-01-14 19:14:43 +08:00
});
2016-01-14 19:50:33 +08:00
var baseTasks = [
'clean',
'sass',
'concat',
2016-01-15 05:17:06 +08:00
'cssmin',
'shell'
2016-01-14 19:50:33 +08:00
];
var devTasks = baseTasks.concat([
'connect',
'watch:scss'
]);
grunt.event.on('watch', function (action, filepath) {
grunt.task.run('shell');
});
2016-01-14 19:14:43 +08:00
2016-01-14 19:50:33 +08:00
grunt.registerTask('dev', devTasks);
grunt.registerTask('build', baseTasks);
grunt.registerTask('default', baseTasks);
2016-01-15 05:21:58 +08:00
grunt.registerTask('publish', ['build', 'gh-pages']);
2016-01-14 20:57:13 +08:00
};