From 000173442471b9f6f6e1b9dfe6a47660210b6d8b Mon Sep 17 00:00:00 2001 From: dethe Date: Sat, 27 Oct 2012 12:45:25 -0700 Subject: [PATCH] updated grunt task --- grunt.js | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 64 insertions(+), 5 deletions(-) diff --git a/grunt.js b/grunt.js index a84d3a4..edb51dd 100644 --- a/grunt.js +++ b/grunt.js @@ -1,8 +1,18 @@ +// Default oBloq Grunt Tasks +// Modify to suit your project +// Requires grunt and grunt-contrib npm modules +// Todo: support server and globals separation +// Todo: default tasks for handlebars, stylus +// +// Note: expects to find oBloq files in bloqs subdirectory +// Will build (and erase each time) directories 'build', 'docs', and 'web' + + module.exports = function(grunt){ grunt.initConfig({ clean: { // Clean will recursively delete entire directories. Be careful - all: ['build','docs'] + all: ['build','docs','web'] }, extract: { build: ['bloqs/*.md', 'bloqs/**/*.md'] @@ -17,11 +27,60 @@ module.exports = function(grunt){ options: { browser: true } + }, + coffee:{ + compile: { + files: { + 'build/*.js': ['build/*.coffee', 'build/**/*.coffee'], + } + } + }, + less: { + development: { + options: { + paths: ['build'] + }, + files: { + 'build/*.css': 'build/*.less' + } + }, + production: { + options: { + paths: ['build'], + yuicompress: true + }, + files: { + 'build/*.css': 'build/*.less' + } + } + }, + copy: { + dist: { + files: { + 'web/views/': ['build/*.html', 'build/**/*.html'] + } + } + }, + concat: { + js: { + src: ['build/*.js', 'build/**/*.js'], + dest: 'web/script.js' + }, + css: { + src: ['build/*.css', 'build/**.css'], + dest: 'web/style.css' + } + }, + min: { + dist:{ + src: 'web/script.js', + dest: 'web/script.min.js' + } } }); - // load extract task - grunt.loadTasks('tasks'); - - grunt.registerTask('default', 'clean extract doc'); + grunt.loadNpmTasks('obloq'); + grunt.loadNpmTasks('grunt-contrib'); + + grunt.registerTask('default', 'clean extract doc less coffee lint concat min'); };