Alan Hay - Experienced Front End Developer and Designer - Based in Barnsley, South Yorkshire. Freelance when available.

24 Mar 14


Grunt File

Here is the Grunt file mentioned in this post

module.exports = function(grunt) {
  grunt.initConfig({
    sass: {
      dist: {
        files: [
        {
          expand: true,
          cwd: 'public/stylesheets/scss/',
          src: ['**/*.scss', '**/_*.scss'],
          dest: 'public/stylesheets/css/',
          ext: '.css'
        },
        ],
        options: {
          outputStyle: 'nested',
          sourceComments: 'normal',
          includePaths: [
          'public/stylesheets/scss/'
          ]
        }
      }
    },
    watch: {
      sass: {
        files: ['public/stylesheets/scss/**/*.scss'],
        tasks: ['sass:dist']
      },
      scripts: {
        files: ['public/javascripts/src/**/*.js'],
        tasks: ['concat:dist']
      },
      livereload: {
        files: ['app/views/**/*.*',
                'app/views/**/**/*.*',
                'app/views/**/**/**/*.*',
                'public/stylesheets/css/*.*',
                'public/javascripts/dist/*.js'],
        options: {
          livereload: 4321
        }
      }
    },
    concat: {
      options: {
        separator: ';',
      },
      dist: {
        src: ['public/javascripts/src/vendor/jquery-1.8.3.min.js',
        'public/javascripts/src/vendor/mediaCheck-min.js',
        'public/javascripts/src/vendor/matchMedia.js',
        'public/javascripts/src/media-query-scripts.js',
        'public/javascripts/src/vendor/picturefill.js',
        'public/javascripts/src/vendor/jquery.slabtext.min.js',
        'public/javascripts/src/vendor/jquery.ba-throttle-debounce.js',
        'public/javascripts/src/vendor/underscore-1.5.2.js',
        'public/javascripts/src/vendor/bigtext.js',
        'public/javascripts/src/plugins.js',
        'public/javascripts/src/script.js',
        'public/javascripts/src/maps.js',
        'public/javascripts/src/menu.js'],
        dest: 'public/javascripts/dist/application.js',
      },
    }
  });
  grunt.loadNpmTasks('grunt-sass');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.registerTask('default', ["sass", "watch", "concat"]);
};