Skip to content

Instantly share code, notes, and snippets.

@jaggy
Last active August 29, 2015 14:02
Show Gist options
  • Save jaggy/a9bfc110713f1de5f968 to your computer and use it in GitHub Desktop.
Save jaggy/a9bfc110713f1de5f968 to your computer and use it in GitHub Desktop.
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']);
}
@jaggy
Copy link
Author

jaggy commented Aug 2, 2014

{
    "name": "",
    "version": "0.1.0",

    "devDependencies": {
        "grunt": "~0.4.5",
        "grunt-contrib-watch": "^0.6.1",
        "grunt-shell": "~0.7.0",
        "grunt-contrib-stylus": "~0.16.0",
        "grunt-imagine": "~0.3.4",
        "autoprefixer-stylus": "~0.1.0"
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment