Skip to content

Instantly share code, notes, and snippets.

@marr
Created January 4, 2014 03:24
Show Gist options
  • Save marr/8251208 to your computer and use it in GitHub Desktop.
Save marr/8251208 to your computer and use it in GitHub Desktop.
"use strict";
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: {
src: ['public/js/**/*.js']
}
},
shell: {
server: {
options: {
failOnError: true
},
command: 'plackup -s Starman -a bin/app.pl'
},
test: {
options: {
stdout: true
},
command: 'npm test'
}
},
sass: {
options: {
trace: true,
require: 'bourbon',
loadPath: 'sass/libs',
style: 'compressed'
},
all: {
files: [{
expand: true,
cwd: 'sass',
filter: function(s) {
return s.match(/_.*?\.scss$/) == null;
},
src: ['*.scss'],
dest: 'public/css',
ext: '.css'
}]
}
},
watch: {
js: {
files: '<%= jshint.all.src %>',
tasks: 'jshint:all',
options: {
spawn: false
}
},
css: {
files: 'sass/**/*.scss',
tasks: 'sass:all',
},
src: {
files: ['t/**/*.t', 'lib/**/*.pl'],
tasks: 'test'
}
}
});
grunt.event.on('watch', function(action, filepath) {
grunt.config('jshint.all.src', filepath);
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-shell');
grunt.registerTask('default', ['watch','test']);
grunt.registerTask('server', ['shell:server', 'watch' ]);
grunt.registerTask('test', ['shell:test']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment