update Grunt version

This commit is contained in:
sudodoki 2013-09-16 20:28:02 +03:00 committed by olapshyn
parent b98ae8ab1d
commit 19fb3ba512
2 changed files with 33 additions and 24 deletions

View file

@ -1,16 +1,20 @@
module.exports = function (grunt) { module.exports = function (grunt) {
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({ grunt.initConfig({
coffee: { coffee: {
lib: { lib: {
src: ['build/morris.coffee'], options: { bare: false },
dest: '.', files: {
options: { bare: false } 'morris.js': ['build/morris.coffee']
}
}, },
spec: { spec: {
src: ['build/spec.coffee'], options: { bare: true },
dest: 'build', files: {
options: { bare: true } 'build/spec.js': ['build/spec.coffee']
} }
},
}, },
concat: { concat: {
'build/morris.coffee': [ 'build/morris.coffee': [
@ -33,24 +37,26 @@ module.exports = function (grunt) {
} }
} }
}, },
min: { uglify: {
'morris.min.js': 'morris.js' build: {
}, files: {
mocha: { 'morris.min.js': 'morris.js'
spec: { }
src: 'spec/specs.html',
run: true
} }
}, },
watch: { mocha: {
index: ['spec/specs.html'],
options: {run: true}
},
npm: {
files: ['lib/**/*.coffee', 'spec/lib/**/*.coffee', 'spec/support/**/*.coffee', 'less/**/*.less'], files: ['lib/**/*.coffee', 'spec/lib/**/*.coffee', 'spec/support/**/*.coffee', 'less/**/*.less'],
tasks: 'default' tasks: 'default'
},
watch: {
files: 'lib/*.coffee' ,
tasks: ['concat:build/morris.coffee', 'coffee:lib']
} }
}); });
grunt.loadNpmTasks('grunt-coffee'); grunt.registerTask('default', ['concat', 'coffee', 'less', 'uglify', 'mocha']);
grunt.loadNpmTasks('grunt-mocha');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.registerTask('default', 'concat coffee less min mocha');
}; };

View file

@ -15,10 +15,13 @@
"url": "https://github.com/oesmith/morris.js/issues" "url": "https://github.com/oesmith/morris.js/issues"
}, },
"devDependencies": { "devDependencies": {
"grunt-coffee": "~> 0.0.6", "grunt": "~0.4.1",
"grunt-mocha": "~> 0.1.7", "grunt-mocha": "~0.4.1",
"grunt-contrib-less": "~> 0.3.2", "grunt-contrib-concat": "~0.3.0",
"grunt": "~> 0.3.17" "grunt-contrib-coffee": "~0.7.0",
"grunt-contrib-uglify": "~0.2.4",
"grunt-contrib-less": "~0.7.0",
"grunt-contrib-watch": "~0.5.3"
}, },
"scripts": { "scripts": {
"test": "./node_modules/.bin/grunt coffee mocha" "test": "./node_modules/.bin/grunt coffee mocha"