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

Grunt: The JavaScript Task Runner

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

Grunt: The JavaScript Task Runner

Slides for my talk at Front-end Developers User Group (Singapore)

Avatar for Sebastiaan Deckers

Sebastiaan Deckers

February 25, 2013
Tweet

More Decks by Sebastiaan Deckers

Other Decks in Programming

Transcript

  1. Automate your build So you can: ... do continuous integration,

    ... release to production without fear, ... work on more interesting things.
  2. package.json { "name": "hello-world", "version": "0.1.0", "dependencies": { "grunt": "~0.4.0",

    "grunt-contrib-jshint": "~0.1.1", "grunt-contrib-uglify": "~0.1.1" } }
  3. Gruntfile.js module.exports = function (grunt) { grunt.initConfig({ uglify: { build:

    { src: 'app.js', dest: 'build/app.min.js' } }, jshint: { all: ['**/*.js'] } }); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.registerTask('default', ['jshint', 'uglify']); };
  4. Poor Man's CI $ sudo -i # crontab -e */5

    * * * * cd /var/www/myapp.com && git reset --hard && git pull origin master && npm install && npm test && grunt