Last active
August 29, 2015 14:02
-
-
Save jaggy/a9bfc110713f1de5f968 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
shell: { | |
runTest: { | |
command: 'phpunit' | |
}, | |
clear: { | |
command: 'clear' | |
}, | |
phpcs: { | |
command: 'phpcs --standard=PSR2 ./app' | |
} | |
}, | |
stylus: { | |
options: { | |
use: [ | |
function() { | |
return require('autoprefixer-stylus')('last 10 versions', 'ie 8', 'ie 9'); | |
} | |
] | |
}, | |
compile: { | |
expand: true, | |
cwd : 'assets/stylus/', | |
src : '*.styl', | |
dest : 'public/css/', | |
ext : '.css' | |
} | |
}, | |
jpgmin: { | |
src: ['assets/images/*.jpg', 'assets/images/*.JPG'], | |
dest: 'public', | |
quality: 75 | |
}, | |
pngnq: { | |
src: ['assets/images/*.png'], | |
dest: 'public' | |
}, | |
watch: { | |
stylus: { | |
files: 'assets/stylus/**/*.styl', | |
tasks: ['stylus:compile'] | |
}, | |
phpunit: { | |
files: ['app/**/*.php', 'app/**/*.xml'], | |
tasks: ['shell:clear', 'shell:runTest', 'shell:phpcs'] | |
}, | |
livereload: { | |
files: ['app/**/*.php', 'app/views/**/*.twig', 'public/**/*.*', 'public/*.*'], | |
options: { livereload: true } | |
} | |
} | |
}); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-contrib-stylus'); | |
grunt.loadNpmTasks('grunt-shell'); | |
grunt.loadNpmTasks('grunt-imagine'); | |
grunt.registerTask('phpunit', ['watch:phpunit']); | |
grunt.registerTask('optimize', ['jpgmin', 'pngnq']); | |
grunt.registerTask('default', ['watch']); | |
} | |
Author
jaggy
commented
Aug 2, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment