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

Introduction to gruntjs

Sam Mason
September 24, 2013

Introduction to gruntjs

A short talk given at Untangle the web on 24/09/2013 @ Skills Matter Exchange

Sam Mason

September 24, 2013
Tweet

More Decks by Sam Mason

Other Decks in Technology

Transcript

  1. Runs all the tasks grunt.initConfig({ Buy Presents: { for girlfriend:

    { Price: >£100 }, for sister: { Price: <£10 } } });
  2. To actually install grunt part 2 package.json { "name": "my-project-name",

    "version": "1.0.0" } Then run in terminal npm install grunt --save-dev
  3. grunt is installed in your project package.json { "name": "your-project",

    "version": "1.0.0", "devDependencies": { "grunt": "~0.4.1" } }
  4. grunt is installed in your project package.json { "name": "your-project",

    "version": "1.0.0", "devDependencies": { "grunt": "~0.4.1", "grunt-contrib": "~0.7.0" } }
  5. the gruntfile - configuration wrapper Gruntfile.js grunt.initConfig({ sass: { dist:

    { options: { style: 'compressed' }, files: { 'css/main.css': 'css/main.scss' } } } });
  6. the gruntfile Gruntfile.js module.exports = function(grunt) { grunt.initConfig({ sass: {

    dist: { options: { style: 'compressed' }, files: { 'css/main.css': 'css/main.scss' } } } }); grunt.loadNpmTasks('grunt-contrib'); grunt.registerTask('default', ['sass']); }