Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Grunt.js for PHP Developers

Grunt.js for PHP Developers

Introduction to Grunt.js for PHP Developers. Slides from my 15 minute talk at the ViennaPHP meetup on April 9, 2014.

Florian Eckerstorfer

April 09, 2014
Tweet

More Decks by Florian Eckerstorfer

Other Decks in Programming

Transcript

  1. Gruntfile.js module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg:

    grunt.file.readJSON('package.json'), ! // Tasks }); ! grunt.loadNpmTasks('PLUGIN_NAME'); ! // Default task(s). grunt.registerTask('default', ['TASK_NAME']); }; ['TASK_NAME_1','TASK_NAME_2']
  2. Gruntfile.js module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg:

    grunt.file.readJSON('package.json'), cssmin: { dist: { files: { 'css/main.min.css': ['css/main.css'] } } } }); ! grunt.loadNpmTasks('grunt-contrib-cssmin'); ! // Default task(s). grunt.registerTask('default', ['cssmin:dist']); }; Task name Target name Options
  3. Gruntfile.js module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), phpunit: {

    test: { dir: '', options: { bin: 'bin/phpunit', configuration: 'app/phpunit.xml' } }, }, }); ! grunt.loadNpmTasks('grunt-phpunit'); ! grunt.registerTask('test', ['phpunit:test']); };