CartoAssets/Gruntfile.js

45 lines
1.0 KiB
JavaScript
Raw Permalink 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'),
2016-01-18 05:20:36 +08:00
copy: require('./tasks/copy'),
2016-01-14 20:57:13 +08:00
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',
2016-01-18 18:16:53 +08:00
'shell:generateFont',
2016-01-14 19:50:33 +08:00
'sass',
'concat',
2016-01-15 05:17:06 +08:00
'cssmin',
2016-01-18 05:20:36 +08:00
'copy',
2016-01-15 05:17:06 +08:00
'shell'
2016-01-14 19:50:33 +08:00
];
2016-01-18 18:16:53 +08:00
var generateFontTask = baseTasks.concat([
'shell:generateFont'
]);
2016-01-14 19:50:33 +08:00
var devTasks = baseTasks.concat([
'connect',
'watch:scss'
]);
grunt.event.on('watch', function (action, filepath) {
2016-01-18 18:16:53 +08:00
grunt.task.run('shell:style');
2016-01-14 19:50:33 +08:00
});
2016-01-14 19:14:43 +08:00
2016-01-14 19:50:33 +08:00
grunt.registerTask('dev', devTasks);
2016-01-18 18:16:53 +08:00
grunt.registerTask('generate-font', generateFontTask);
2016-01-14 19:50:33 +08:00
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
};