<commit_before>module.exports = function(grunt) {

  'use strict';

  var path = require('path');

  var config = {

    /**
     * Pull in the package.json file so we can read its metadata.
     */
    pkg: grunt.file.readJSON('bower.json'),
    
    /**
     * Bower: https://github.com/yatskevich/grunt-bower-task
     * 
     * Install Bower packages and migrate static assets.
     */
    bower: {
      install: {
        options: {
          targetDir: './vendor/',
          install: true,
          verbose: true,
          cleanBowerDir: true,
          cleanTargetDir: true,
          layout: function(type, component) {
            if (type === 'img') {
              return path.join('../static/img');
            } else if (type === 'fonts') {
              return path.join('../static/fonts');
            } else {
              return path.join(component);
            }
          }
        }
      }
    },

    /**
     * String replace: https://github.com/erickrdch/grunt-string-replace
     * 
     * Replace strings on files by using string or regex patters.
     */
    'string-replace': {
      chosen: {
        files: {
          'vendor/chosen/': 'vendor/chosen/chosen.css'
        }
      },
      options: {
        replacements: [{
          pattern: /url\('chosen-sprite.png'\)/ig,
          replacement: 'url("../img/chosen-sprite.png")'
        },
        {
          pattern: /url\('chosen-sprite@2x.png'\)/ig,
          replacement: 'url("../img/chosen-sprite@2x.png")'
        }]
      }
    },

    /**
     * Concat: https://github.com/gruntjs/grunt-contrib-concat
     * 
     * Concatenate cf-* Less files prior to compiling them.
     */
    concat: {
      'cf-less': {
        src: [
          'vendor/cf-*/*.less'
        ],
        dest: 'vendor/cf-concat/cf.less',
      },
      bodyScripts: {
        src: [
          'vendor/jquery/jquery.js',
          'vendor/chosen/chosen.jquery.js',
          'vendor/cf-*/*.js',
          'static/js/jquery.custom-input.js',
          'static/js/app.js'
        ],
        dest: 'static/js/main.js'
      }
    },

    /**
     * Less: https://github.com/gruntjs/grunt-contrib-less
     * 
     * Compile Less files to CSS.
     */
    less: {
      main: {
        options: {
          paths: grunt.file.expand('vendor/**/'),
        },
        files: {
          'static/css/main.css': ['static/css/main.less']
        }
      },
      ie8: {
        options: {
          paths: ['static'],
        },
        files: {
          'static/css/ie8.css': ['static/css/ie/ie8.less']
        }
      }
    },

    /**
     * Autoprefixer: https://github.com/nDmitry/grunt-autoprefixer
     * 
     * Parse CSS and add vendor-prefixed CSS properties using the Can I Use database.
     */
    autoprefixer: {
      options: {
        // Options we might want to enable in the future.<commit_msg>Remove IE less task. The IE stylesheet is created with legacssy and IE7 icon support uses conditional comments.<commit_after>module.exports = function(grunt) {

  'use strict';

  var path = require('path');

  var config = {

    /**
     * Pull in the package.json file so we can read its metadata.
     */
    pkg: grunt.file.readJSON('bower.json'),
    
    /**
     * Bower: https://github.com/yatskevich/grunt-bower-task
     * 
     * Install Bower packages and migrate static assets.
     */
    bower: {
      install: {
        options: {
          targetDir: './vendor/',
          install: true,
          verbose: true,
          cleanBowerDir: true,
          cleanTargetDir: true,
          layout: function(type, component) {
            if (type === 'img') {
              return path.join('../static/img');
            } else if (type === 'fonts') {
              return path.join('../static/fonts');
            } else {
              return path.join(component);
            }
          }
        }
      }
    },

    /**
     * String replace: https://github.com/erickrdch/grunt-string-replace
     * 
     * Replace strings on files by using string or regex patters.
     */
    'string-replace': {
      chosen: {
        files: {
          'vendor/chosen/': 'vendor/chosen/chosen.css'
        }
      },
      options: {
        replacements: [{
          pattern: /url\('chosen-sprite.png'\)/ig,
          replacement: 'url("../img/chosen-sprite.png")'
        },
        {
          pattern: /url\('chosen-sprite@2x.png'\)/ig,
          replacement: 'url("../img/chosen-sprite@2x.png")'
        }]
      }
    },

    /**
     * Concat: https://github.com/gruntjs/grunt-contrib-concat
     * 
     * Concatenate cf-* Less files prior to compiling them.
     */
    concat: {
      'cf-less': {
        src: [
          'vendor/cf-*/*.less'
        ],
        dest: 'vendor/cf-concat/cf.less',
      },
      bodyScripts: {
        src: [
          'vendor/jquery/jquery.js',
          'vendor/chosen/chosen.jquery.js',
          'vendor/cf-*/*.js',
          'static/js/jquery.custom-input.js',
          'static/js/app.js'
        ],
        dest: 'static/js/main.js'
      }
    },

    /**
     * Less: https://github.com/gruntjs/grunt-contrib-less
     * 
     * Compile Less files to CSS.
     */
    less: {
      main: {
        options: {
          paths: grunt.file.expand('vendor/**/'),
        },
        files: {
          'static/css/main.css': ['static/css/main.less']
        }
      }
    },

    /**
     * Autoprefixer: https://github.com/nDmitry/grunt-autoprefixer
     * 
     * Parse CSS and add vendor-prefixed CSS properties using the Can I Use database.
     */
    autoprefixer: {
      options: {
        // Options we might want to enable in the future.
{'fraction_non_alphanumeric': 0.1518564138659159, 'fraction_numerical': 0.0014077071969030442, 'mean_word_length': 1.4648742411101474, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4062877', 'n_tokens_mistral': 1824, 'n_tokens_neox': 1807, 'n_words': 333}